liveBook · Manning

Group

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A collection of Kubernetes user identities represented in authentication credentials for authorization decisions.

A group is an identity label carried by authentication credentials and used by RBAC authorization. Kubernetes does not maintain ordinary users or groups in a built-in directory; client certificates can provide a username and optional group information. section 3.2 section 3.4

Use groups when permissions should apply to multiple identities:

  • Place the user name in the certificate common name (CN) and the group in the organization (O), such as CN=carol/O=developers. section 3.2
  • For a Kubernetes CertificateSigningRequest, declare the group under spec.groups and request client authentication. section 3.2
  • Bind a Role or ClusterRole to the group through a RoleBinding or ClusterRoleBinding; the binding supplies the permissions. section 3.4 section 9.3.2
  • Verify the effective access by switching to the user context and running kubectl auth can-i or an allowed and forbidden operation. section 3.2 section 3.4

Give the developers group pod-reader access

Create or retain a pod-reader Role, then bind it to the developers group with kubectl create rolebinding pod-reader-bind --role=pod-reader --group=developers. After switching to Carol's kubeconfig context, kubectl get po succeeds while kubectl delete po nginx returns Forbidden. Replacing the binding with the group subject grants the same role without changing Carol's certificate. section 3.2

Figure 3.11 Creating a kubeconfig for a new user and generating a certificate using the certificate signing request
figure

Trace the operational path from certificate identity and group assignment through kubeconfig creation and API access. section 3.2

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Explains certificate encoding, CertificateSigningRequest fields, bindings, kubeconfig contexts, and permitted versus forbidden operations.
Examples
Uses Carol, the developers group, a pod-reader binding, CertificateSigningRequest YAML, kubeconfig contexts, and pod access checks.
What it assumes
Assumes basic Kubernetes resources and kubectl, while teaching certificate-based user creation and RBAC group assignment.
What you can do after
Apply group-based RBAC with kubectl, construct certificate credentials, switch contexts, and verify effective permissions.
How it connects
Connects authentication, client certificates, CertificateSigningRequest, RBAC, RoleBinding, ClusterRoleBinding, users, and Service Accounts.

Also explained in

Compare how 2 books explain group →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.