Valid CKA Dumps shared by ExamDiscuss.com for Helping Passing CKA Exam! ExamDiscuss.com now offer the newest CKA exam dumps, the ExamDiscuss.com CKA exam questions have been updated and answers have been corrected get the newest ExamDiscuss.com CKA dumps with Test Engine here:
Score: 4% Context You have been asked to create a new ClusterRole for a deployment pipeline and bind it to a specific ServiceAccount scoped to a specific namespace. Task Create a new ClusterRole named deployment-clusterrole, which only allows to create the following resource types: * Deployment * StatefulSet * DaemonSet Create a new ServiceAccount named cicd-token in the existing namespace app-team1. Bind the new ClusterRole deployment-clusterrole lo the new ServiceAccount cicd-token , limited to the namespace app-team1.
Correct Answer:
See the solution below. Explanation Solution: Task should be complete on node -1 master, 2 worker for this connect use command [student@node-1] > ssh k8s kubectl create clusterrole deployment-clusterrole --verb=create --resource=deployments,statefulsets,daemonsets kubectl create serviceaccount cicd-token --namespace=app-team1 kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole --serviceaccount=default:cicd-token --namespace=app-team1
Recent Comments (The most recent comments are at the top.)
Recent Comments (The most recent comments are at the top.)
kubectl create serviceaccount cicd-token --namespace=app-team1
kubectl create clusterrole deployment-clusterrole --verb=create --resource=Deployment,statefulset,daemonsets
kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole --serviceaccount=app-team1:cicd-token
root@controlplane ~ ➜ kubectl auth can-i create Deployment --as=system:serviceaccount:app-team1:cicd-token
yes
i have done rolebinding but its not working. how we have to test with kubectl auth can-i create deployments --as=system:serviceaccount
kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole
--serviceaccount=default:cicd-token --namespace=app-team1
please suggest which one is the right one.
so what we have to mention in rolebinding (name) its same name ? deployment-clusterrole
should be --serviceaccount=app-team1:cicd-token not --serviceaccount=default:cicd-token as you created serviceaccount in namespace app-team1
as the question say limited to the namespace so u cant use clusterrolebinding
Last command should say clusterrolebinding - not rolebding. Also, there is no need to specify the namespace.