100% Latest & Updated CNCF CKA Practice Test Questions, Exam Dumps & Verified Answers!
30 Days Free Updates, Instant Download!
Question 20
A reviewer wants to test whether ServiceAccount build/agent can delete Pods in namespace staging without deleting anything. Which RBAC validation conclusions are sound? Choose ONE answer.
- kubectl auth can-i grants the delete permission when it returns no.
- The check must delete a Pod to compute authorization.
- kubectl auth can-i delete pods -n staging --as=system:serviceaccount:build:agent is a targeted authorization check.
- Testing as system:serviceaccount:staging:agent checks build/agent.
Explanation
Correct Answer
C:Impersonation uses the exact service-account username format.
Incorrect Answers
A:The command evaluates effective authorization without changing grants.
B:SelfSubjectAccessReview performs an authorization query, not a deletion.
D:The service-account namespace is part of the identity string.
Question 21
A team binds the built-in ClusterRole `view` to a developer in a namespace. The developer can read most workloads but cannot read Secret objects. Why is that expected? Choose ONE answer.
- Every Secret is cluster-scoped and cannot be read through namespace bindings.
- A Service is required to proxy Secret API reads.
- The built-in view role intentionally excludes Secret reads to avoid leaking service-account credentials.
- The built-in view role has a deny rule for all Secrets that administrators cannot change.
Explanation
Correct Answer
C:Kubernetes treats Secret data as sensitive and the default view role does not grant access to it.
Incorrect Answers
A:Secrets are namespaced resources; scope is not the reason for the default role exclusion.
B:Secrets are API objects and do not require an application Service to be listed.
D:RBAC is additive and has no deny rules; the permission is simply absent.
Question 22
In namespace `gamma`, a RoleBinding refers to the Role `review-35`, whose rule grants `patch` on `configmaps` in the core API group (`apiGroups: [""]` in RBAC YAML); its subject is ServiceAccount `finance/deploy-agent`. The binding is in `gamma`, and no other RBAC grants exist. Determine the effective access and the boundaries of this grant. Choose ONE statement.
- The binding grants `patch` on `deployments` because it shares the same namespace.
- The same ServiceAccount has no authorization from this binding to perform `patch` on `configmaps` in `finance`.
- The binding grants `delete` on `configmaps` because the ServiceAccount can perform `patch`.
- ServiceAccount `finance/deploy-agent` automatically gains `patch` on `configmaps` in every namespace.
Explanation
Correct Answer
B:A RoleBinding grants permissions only in its own namespace `gamma`, even if it refers to a ClusterRole. For this authorization request, the target grant namespace is gamma, the rule specifies verb patch on configmaps, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
Incorrect Answers
A:The rule names `configmaps`, not `deployments`; matching namespace alone does not add RBAC resources. For this authorization request, the target grant namespace is gamma, the rule specifies verb patch on configmaps, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
C:Kubernetes does not infer `delete` from `patch`; each verb must be granted explicitly. For this authorization request, the target grant namespace is gamma, the rule specifies verb patch on configmaps, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
D:The shown RoleBinding is scoped to `gamma`; a cluster-wide permission on namespaced resources would require a ClusterRoleBinding to an appropriate ClusterRole. For this authorization request, the target grant namespace is gamma, the rule specifies verb patch on configmaps, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
Question 23
A Role permits `list` on configmaps only with `resourceNames: [pricing]`. A client calls `kubectl get configmaps` with no field selector and receives Forbidden. What change to the request matches the restriction? Choose ONE answer.
- Add --all-namespaces to the list request.
- List with a metadata.name=pricing field selector.
- Use list without any selector as cluster-admin.
- Request the Secret pricing instead.
Explanation
Correct Answer
B:For list/watch restricted by resourceNames, the name must be supplied through the matching metadata.name field selector.
Incorrect Answers
A:Broader namespace scope does not satisfy the named-object restriction.
C:The relevant Role does not authorize an unrestricted list of this resource.
D:The rule applies to ConfigMaps and does not cover Secrets.
Question 24
A RoleBinding in namespace reports references ClusterRole view-read and names user marina. Where does that binding grant namespaced-resource permissions? Choose ONE answer.
- Only for non-resource URLs cluster-wide.
- In all namespaces because ClusterRole is global.
- Only in kube-system.
- Only in reports.
Explanation
Correct Answer
D:A RoleBinding limits namespaced permissions to its namespace even when roleRef targets a ClusterRole.
Incorrect Answers
A:Namespaced RoleBindings do not grant cluster-scoped non-resource URL access.
B:The binding type, not just the referenced role kind, controls scope.
C:Nothing about the binding grants access in kube-system.
Question 25
An administrator wants to verify whether ServiceAccount `jobs/runner` can create ConfigMaps in jobs before issuing a new grant. Which command offers a targeted authorization check when run by a user allowed to impersonate? Choose ONE answer.
- `kubectl label namespace jobs create=configmaps`.
- `kubectl auth can-i create configmaps -n jobs --as=system:serviceaccount:jobs:runner`.
- `kubectl get nodes` and infer namespace write permissions.
- `kubectl get serviceaccounts -n jobs` and assume every account is authorized.
Explanation
Correct Answer
B:kubectl auth can-i submits a SubjectAccessReview for the specified verb/resource and impersonated identity.
Incorrect Answers
A:Adding an arbitrary label is not an RBAC authorization test.
C:Node visibility does not establish the ServiceAccount’s resource authorization.
D:Listing ServiceAccounts reveals identities, not the effective rule set.
Question 26
A support account has get on pods/log but no other Pod subresource grants. Choose TWO valid conclusions. Choose TWO answers.
- Retrieving Pod logs may be authorized by this rule.
- Running `kubectl exec` is not granted by pods/log alone.
- It automatically gets every Secret in the namespace.
- It can delete Pods because get is a stronger verb.
- It can create Deployments by reading logs.
Explanation
Correct Answers
A:pods/log is the designated log subresource for a GET request.
B:Exec uses a different Pod subresource and an independent verb authorization.
Incorrect Answers
C:Secrets are a separate core resource.
D:RBAC verbs are independent and get does not imply delete.
E:Log-read authorization does not confer app workload creation.
Question 27
In namespace `beta`, a RoleBinding refers to the Role `review-40`, whose rule grants `get` on `pods/log` in the core API group (`apiGroups: [""]` in RBAC YAML); its subject is ServiceAccount `observability/ops-console`. The binding is in `beta`, and no other RBAC grants exist. Determine the effective access and the boundaries of this grant. Choose THREE statements.
- The same ServiceAccount has no authorization from this binding to perform `get` on `pods/log` in `sandbox`.
- ServiceAccount `observability/ops-console` can perform `get` on `pods/log` in `beta`.
- The binding grants `get` on `events` because it shares the same namespace.
- This binding alone does not grant `delete` on `pods/log` in `beta`.
- ServiceAccount `observability/ops-console` automatically gains `get` on `pods/log` in every namespace.
- The binding grants `delete` on `pods/log` because the ServiceAccount can perform `get`.
Explanation
Correct Answers
A:A RoleBinding grants permissions only in its own namespace `beta`, even if it refers to a ClusterRole.
B:The RoleBinding in `beta` selects exactly that ServiceAccount identity and the rule grants `get` on `pods/log` within this namespace.
D:RBAC rules are additive and verb-specific; `delete` is absent while `get` is the only listed verb for `pods/log`.
Incorrect Answers
C:The rule names `pods/log`, not `events`; matching namespace alone does not add RBAC resources. For this authorization request, the target grant namespace is beta, the rule specifies verb get on pods/log, the subject is observability/ops-console. RBAC evaluates the verb, resource, group, subject and binding scope together.
E:The shown RoleBinding is scoped to `beta`; a cluster-wide permission on namespaced resources would require a ClusterRoleBinding to an appropriate ClusterRole. For this authorization request, the target grant namespace is beta, the rule specifies verb get on pods/log, the subject is observability/ops-console. RBAC evaluates the verb, resource, group, subject and binding scope together.
F:Kubernetes does not infer `delete` from `get`; each verb must be granted explicitly. For this authorization request, the target grant namespace is beta, the rule specifies verb get on pods/log, the subject is observability/ops-console. RBAC evaluates the verb, resource, group, subject and binding scope together.
Question 28
A user has one RoleBinding allowing get on Pods and a second allowing delete on Pods, both in namespace testing. A new deny-style Role rule is proposed to remove delete. What is the correct RBAC assessment? Choose ONE answer.
- RBAC permissions are additive; remove the delete grant to revoke it.
- A deny Role overrides the delete permission.
- The second RoleBinding cancels the first.
- A RoleBinding only grants one verb at a time.
Explanation
Correct Answer
A:Native Kubernetes RBAC does not contain a general deny rule that subtracts an existing allow.
Incorrect Answers
B:The RBAC API is allow-only rather than an allow/deny precedence system.
C:Independent grants are unioned, not overwritten chronologically.
D:Multiple verbs can be granted through multiple rules or bindings.
Question 29
In namespace `delta`, a RoleBinding refers to the Role `review-43`, whose rule grants `create` on `pods/exec` in the core API group (`apiGroups: [""]` in RBAC YAML); its subject is ServiceAccount `finance/deploy-agent`. The binding is in `delta`, and no other RBAC grants exist. Determine the effective access and the boundaries of this grant. Choose ONE statement.
- ServiceAccount `finance/deploy-agent` can perform `create` on `pods/exec` in `delta`.
- The binding grants `create` on `statefulsets` because it shares the same namespace.
- ServiceAccount `finance/deploy-agent` automatically gains `create` on `pods/exec` in every namespace.
- The binding grants `delete` on `pods/exec` because the ServiceAccount can perform `create`.
Explanation
Correct Answer
A:The RoleBinding in `delta` selects exactly that ServiceAccount identity and the rule grants `create` on `pods/exec` within this namespace.
Incorrect Answers
B:The rule names `pods/exec`, not `statefulsets`; matching namespace alone does not add RBAC resources. For this authorization request, the target grant namespace is delta, the rule specifies verb create on pods/exec, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
C:The shown RoleBinding is scoped to `delta`; a cluster-wide permission on namespaced resources would require a ClusterRoleBinding to an appropriate ClusterRole. For this authorization request, the target grant namespace is delta, the rule specifies verb create on pods/exec, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
D:Kubernetes does not infer `delete` from `create`; each verb must be granted explicitly. For this authorization request, the target grant namespace is delta, the rule specifies verb create on pods/exec, the subject is finance/deploy-agent. RBAC evaluates the verb, resource, group, subject and binding scope together.
Question 30
A ClusterRoleBinding points to ClusterRole read-nodes, which authorizes get on cluster-scoped nodes. A team replaces the binding with a RoleBinding in namespace ops. What are the implications? Choose ONE answer.
- The RoleBinding cannot grant access to cluster-scoped Node resources.
- ClusterRoleBinding automatically grants delete on Nodes.
- The binding grants get on Nodes only whose names start with ops.
- A RoleBinding makes Nodes namespaced in ops.
Explanation
Correct Answer
A:A namespaced binding cannot grant cluster-scoped permissions.
Incorrect Answers
B:Binding does not introduce verbs absent from the ClusterRole.
C:Namespace names cannot scope Node identity.
D:Node objects are always cluster-scoped.
Certified Kubernetes Administrator (CKA) Practice Tests