Subjects in RBAC
What you'll learn: You'll discover the three types of subjects that RBAC rules apply to in Kubernetes and how they represent different kinds of actors in your cluster.
The Core Concept
In Kubernetes RBAC, a subject is the "who" in access control — the entity requesting permission to perform an action. Every RBAC policy needs to know who is asking before it can decide whether to allow or deny access. Kubernetes recognizes three distinct types of subjects: Users, Groups, and ServiceAccounts.
Think of subjects like different types of identification cards at a secured building: employee badges (Users), department passes (Groups), and automated system credentials (ServiceAccounts). Each type serves a different purpose but all go through the same security checkpoint.
The Three Subject Types
Users represent human operators or external systems. Kubernetes doesn't manage user accounts itself — they're typically handled by external identity providers like LDAP, cloud IAM, or certificate-based authentication. When you use kubectl, you're acting as a User.
Groups are collections of Users, allowing you to apply permissions to multiple people at once. Instead of granting access to 50 individual developers, you grant it to the "developers" Group. Groups are also provided by your identity system.
ServiceAccounts are Kubernetes-managed identities for Pods and processes running inside the cluster. When your application needs to talk to the Kubernetes API (like a deployment controller or monitoring agent), it uses a ServiceAccount — not a human User.
How They're Referenced
In RBAC role bindings, subjects are specified with a kind field indicating the type, plus identifying information like name and namespace (for ServiceAccounts only).
Key Takeaway: RBAC subjects come in three flavors — Users and Groups for humans/external systems, and ServiceAccounts for workloads running inside Kubernetes — and understanding which to use is fundamental to securing cluster access.