Study. uk . com
  1. Home
  2. All questions
  3. Question 924

CKA study material · question 924 of 1000

You want to know whether the ServiceAccount build-bot in namespace ci may create Pods in namespace prod. Which command answers that?

  1. kubectl auth can-i create pods --as=system:serviceaccount:ci:build-bot -n prod
  2. kubectl describe serviceaccount build-bot -n ci
  3. kubectl get rolebindings -n prod -o wide
  4. kubectl auth reconcile -f role.yaml --dry-run=server
Show the answer

Answer: A. kubectl auth can-i create pods --as=system:serviceaccount:ci:build-bot -n prod

auth can-i combined with --as answers the authorization question for another identity directly, rather than requiring the bindings to be read and reasoned about.

Source: kubectl auth can-i (Kubernetes) — Synopsis

Challenge yourself on this topic → Study as cards