CertLumen

Certified Kubernetes Administrator (CKA) · Section 1 · 25% of the exam

Manage role based access control (RBAC)

One of the objectives of the Certified Kubernetes Administrator (CKA) exam, in the section “Cluster Architecture, Installation and Configuration”. Here is what it covers, the points to remember and a question to try.

What it covers

RBAC decides what an authenticated user, group or ServiceAccount may do in the Kubernetes API. This lesson covers Roles, ClusterRoles and their bindings, the verbs and resources in rules, default roles, ServiceAccounts, creating a client-certificate user, and testing permissions with kubectl auth can-i.

Points to remember

  • RBAC is additive: no deny rules; permissions are the union of all matching bindings.
  • Role and RoleBinding are namespaced; ClusterRole and ClusterRoleBinding are cluster-wide.
  • A RoleBinding to a ClusterRole grants those permissions only in the binding's namespace.
  • Core API group is the empty string ""; Deployments are in apps.
  • Sub-resources (pods/log, pods/exec) must be listed explicitly.

Try a question

A batch Pod never calls the Kubernetes API. To follow least privilege, which Pod setting stops the ServiceAccount token from being mounted into the containers?

  1. AserviceAccountName: none
  2. BsecurityContext.readOnlyRootFilesystem: true
  3. CautomountServiceAccountToken: false
  4. DhostNetwork: true
Show the answer

C. Pods get a projected, short-lived ServiceAccount token by default. Disable the mount with automountServiceAccountToken: false on the Pod spec or on the ServiceAccount.

Written for practice in the style of the exam: never a question from the real exam.

In the course

The lesson Role-based access control (RBAC) teaches this objective (about 45 minutes), and 14 practice questions test it. The course has lessons, exam-style questions, timed practice exams and an AI tutor for every objective, and a pass prediction that tells you when you're ready to book.

More in this section

All 27 objectives · Next objective →