CKA — RBAC & Security
Chapter Overview
Every Kubernetes cluster has resources — Pods, Secrets, ConfigMaps, Nodes — and RBAC (Role-Based Access Control) decides who can do what with them.
Without RBAC, anyone with cluster access could delete Deployments, read Secrets, or modify Nodes. That’s a nightmare in production.
This chapter covers Domain 1: Cluster Architecture, Installation & Configuration (25%) of the CKA exam, specifically the RBAC and security portions. You’ll learn how to create Roles, bind them to users and ServiceAccounts, test permissions, and secure Pods with Security Contexts.
Think of RBAC as the lock and key system for your cluster. You define what actions are allowed (Roles), then hand out keys to the right people (Bindings).
What You’ll Learn
| # | Topic | Description |
|---|---|---|
| 1 | Roles & ClusterRoles | Role vs ClusterRole, permissions, verbs, apiGroups |
| 2 | RoleBindings & ClusterRoleBindings | Binding roles to users, groups, ServiceAccounts |
| 3 | ServiceAccounts | Default SA, token projection, automounting |
| 4 | Testing RBAC | kubectl auth can-i, impersonation, debugging |
| 5 | Security Contexts | Pod/container security, runAsUser, readOnlyRootFilesystem |
| 6 | Hands-On Lab | Create Roles, bind them, test permissions |
CKA Exam Relevance
This chapter maps directly to Cluster Architecture, Installation & Configuration — 25% of the CKA exam.
Specifically, you’ll be tested on:
- Use Role-Based Access Controls to define and manage permissions
- Create and manage Roles, ClusterRoles, RoleBindings, and ClusterRoleBindings
- Manage ServiceAccounts and their token automation
- Apply Security Contexts to Pods and containers
RBAC questions show up in almost every CKA exam. The good news? The patterns are predictable once you understand the building blocks.
Prerequisites
Before starting this chapter, make sure you have:
- ✅ Completed the Introduction chapter (basic kubectl, cluster concepts)
- ✅ A working Kubernetes cluster (minikube, kind, or kubeadm)
- ✅
kubectlconfigured and connected to your cluster - ✅ Familiarity with namespaces and basic resource types (Pods, Deployments)
What’s Next?
We’ll start with the foundation — understanding Roles and ClusterRoles, the objects that define what actions are allowed on which resources.