Skip to main content
In this lesson we cover how to manage TLS certificates in Kubernetes and how the Certificates API automates certificate signing and rotation. Traditionally, a cluster administrator generates and protects a cluster signing CA (a private key and root certificate). These CA files are extremely sensitive: anyone who obtains the private key can sign certificates and effectively create identities with cluster privileges. For that reason, the CA key pair must be stored securely — ideally on a dedicated CA server or in a secure key-management solution. In small clusters these CA files are often kept on a control-plane host (for example, kubeadm stores the CA pair there). Initially signing Certificate Signing Requests (CSRs) may be done manually, but as the number of users and workloads grows you should adopt an automated, auditable process. Kubernetes’ Certificates API provides exactly that: it accepts CSRs as API objects, enables administrative review and approval, and — when configured — signs approved CSRs with the cluster signing CA.
A stylized diagram showing two "Admin" user icons on the left and three server/master node illustrations on the right, one labeled "Certificates API." Below the nodes is a numbered list of steps: "Create CertificateSigningRequest Object," "Review Requests," and "Approve Requests."
How the Certificates API workflow looks in practice
  1. A user generates a private key locally and creates a CSR.
  2. The user submits the CSR to the Kubernetes API as a CertificateSigningRequest object.
  3. Administrators list and review pending CSR objects, then approve or deny them (for example, with kubectl).
  4. If approved and if the controller manager is configured to sign, Kubernetes signs the CSR with the cluster signing CA and stores the issued certificate in the CSR object’s status.certificate field.
  5. The user or administrator extracts the issued certificate and combines it with the private key for authentication or TLS.
Best practice: keep the CA signing key tightly controlled and auditable. If the controller manager has the signing key, restrict who can access and modify controller-manager startup files and flags. Quick example: generate a key and CSR locally Generate a private key (creates jane.key):
Create a CSR with the private key (creates jane.csr):
Preview of a CSR (PEM text):
Base64-encode the CSR (to populate the request field in the manifest):
Create the CertificateSigningRequest manifest
  • The request field must contain the base64-encoded CSR.
  • Choose an appropriate signerName and usages for the CSR’s purpose.
Example manifest (v1 Certificates API):
Choose signerName and usages that match the intended purpose. For client authentication, use kubernetes.io/kube-apiserver-client. For serving certificates (TLS for an API endpoint), use a serving signer such as kubernetes.io/kube-apiserver-serving. Check your cluster’s available signers and your security policy before approving CSRs.
Submit the CSR object to the API:
List pending CSRs:
Approve a CSR (administrator action):
View the CSR including its status and the issued certificate (if signed):
Extract the issued certificate (the status.certificate field is base64-encoded) and save it as jane.crt:
You can then provide jane.key and jane.crt to the user for client authentication or TLS. Common signerName and usages examples Controller behavior and where signing happens All certificate automation is implemented by controllers in the kube-controller-manager. These controllers:
  • Expose pending CertificateSigningRequest objects for administrators to review.
  • Optionally auto-approve CSRs based on configured rules.
  • Sign CSRs using the cluster signing CA when allowed.
For the controller manager to sign CSRs it needs access to the cluster signing CA key and certificate (for example, via --cluster-signing-cert-file and --cluster-signing-key-file). Because possession of these files grants signing authority, they must be stored and accessed securely — preferably using a secure key-management solution and with strict access controls on the controller manager.
A stylized diagram of a Kubernetes control plane inside a dotted host. It shows four components: kube-apiserver, etcd Server, Controller-Manager, and kube-scheduler.
Commands cheat sheet Summary
  • The Certificates API allows users to submit CSRs as Kubernetes objects that administrators can review and approve.
  • Administrators use kubectl (or automated workflows) to approve or deny CSRs.
  • The kube-controller-manager can sign approved CSRs if it is configured with the cluster signing CA (--cluster-signing-cert-file and --cluster-signing-key-file).
  • Securely store and limit access to the cluster signing CA key pair — compromise of that key lets an attacker mint cluster certificates.
Store the cluster signing CA key pair securely and restrict access to the controller manager. Compromise of these files allows forging cluster identities.
Further reading and references

Watch Video

Practice Lab