Until Kubernetes 1.34, a Pod had exactly one native identity credential: a ServiceAccount token, a bearer JWT. Anything that wanted X.509 for a workload (mutual TLS between services, a client certificate for an external system, a SPIFFE-style identity) had to be bolted on by a service mesh, a cert-manager style controller, or a sidecar that talked to a CA out of band. Kubernetes 1.37, the version the CKS exam currently runs on, closes that gap. Two APIs in certificates.k8s.io/v1 are now GA: PodCertificateRequest, which lets the kubelet obtain a certificate for a Pod with a private key that never leaves the node, and ClusterTrustBundle, which distributes CA trust anchors to workloads as a first-class object instead of a ConfigMap you hope is up to date.
The CKS curriculum does not name either object, and that is exactly why this article exists. The exam is built on a live 1.37 cluster, its Cluster Hardening and Minimize Microservice Vulnerabilities domains are about restricting API access and implementing pod-to-pod encryption, and anything that shows up in kubectl api-resources under certificates.k8s.io is fair game for a question that tests whether you understand what it does and who may do what to it. Our earlier post on kubelet TLS bootstrapping covered these two objects in a three-bullet awareness section. This is the full treatment: every field, every validation rule, every RBAC verb, the exact lifecycle, and how it compares with the alternatives you already know.
Where this sits on the CKS
The CKS runs on Kubernetes 1.37 with six domains weighted 15/15/10/20/20/20: Cluster Setup, Cluster Hardening, System Hardening, Minimize Microservice Vulnerabilities, Supply Chain Security, and Monitoring, Logging and Runtime Security. Pod certificates and trust bundles touch three of them:
- Cluster Hardening (15%): “Use Role Based Access Controls to minimize exposure” and “Exercise caution in using service accounts”. The RBAC around signers (the
signandattestverbs), the Node authorizer’s handling of PodCertificateRequests, and the question of when a workload should have an X.509 identity instead of a ServiceAccount token all live here. - Minimize Microservice Vulnerabilities (20%): “Implement Pod-to-Pod encryption using Cilium” and the broader mTLS topic. Pod certificates are the Kubernetes-native primitive a mesh or an application can use for mutual TLS, and ClusterTrustBundles are how the peer learns which CA to trust.
- Cluster Setup (15%): “Appropriately set up Ingress with TLS” and protecting node metadata. The
kubernetes.io/kube-apiserver-servingsigner and its published trust bundle are part of how clients verify the API server itself.
Expect awareness-level and reasoning-level questions rather than “write a signer controller”. Typical shapes: a Pod is stuck in ContainerCreating with an event about a PodCertificateRequest; a ServiceAccount cannot create a ClusterTrustBundle for a signer; a team wants mTLS without a mesh and asks what Kubernetes provides natively; a manifest mounts a bundle that does not exist and the Pod will not start. Everything you need for each of those is below.
Why pod certificates exist
A projected ServiceAccount token is a bearer credential. Whoever holds the JWT is the Pod as far as any audience is concerned. That has three consequences the KEP (KEP-4317) set out to fix:
- Bearer tokens leak by being presented. Every hop that sees the token can replay it until it expires. An X.509 private key is never sent anywhere; the certificate is, and the certificate is useless without the key. With pod certificates, the private key is generated by the kubelet on the node and never leaves it; only the public key (inside a stub CSR) travels to the API server and the signer.
- TLS wants X.509. Mutual TLS, client certificates for databases and brokers, and the SPIFFE ecosystem all speak certificates. A JWT has to be wrapped in a header and validated by application code; a certificate is validated by the TLS stack.
- Third-party CAs speak PKCS#10. Because the request carries a real (if minimal) PKCS#10 CSR, a signer can forward it to any CA that accepts CSRs, such as an enterprise PKI or a secrets manager, without re-encoding.
A fourth design point matters for security reasoning: the API server enforces node restriction on the request, so a signer does not have to re-implement “is this kubelet really allowed to ask for a certificate for this Pod?” That check is centralised, exactly as it is for ServiceAccount tokens requested by the kubelet.
Feature timeline, so you know what the exam cluster has
| Feature gate | Alpha | Beta | GA (on by default) | What it controls |
|---|---|---|---|---|
ClusterTrustBundle | 1.27 | 1.33 | 1.37 | The ClusterTrustBundle API in kube-apiserver, and the controller manager publishing a bundle for kubernetes.io/kube-apiserver-serving |
ClusterTrustBundleProjection | 1.29 | 1.33 | 1.37 | The clusterTrustBundle projected volume source |
PodCertificateRequest | 1.34 | 1.35 | 1.37 | The PodCertificateRequest API and the podCertificate projected volume source |
Two historical details show up as distractors. First, in the beta releases the gates were off by default, so a 1.35 or 1.36 cluster needed them enabled explicitly; a 1.37 cluster does not. Second, 1.36 changed the PodCertificateRequest spec: it added stubPKCS10Request and deprecated the older pkixPublicKey and proofOfPossession fields. The v1 API dropped the deprecated fields; v1beta1 still carries them. If you see pkixPublicKey in a manifest, it is pre-1.36 beta material.
Everything below describes certificates.k8s.io/v1 on 1.37.
The podCertificate projected volume: what the Pod author writes
A pod certificate is requested the same way a projected ServiceAccount token is: as a source inside a projected volume.
apiVersion: v1
kind: Pod
metadata:
name: podcertificate-pod
namespace: default
spec:
serviceAccountName: default
containers:
- name: main
image: debian
command: ["sleep", "infinity"]
volumeMounts:
- name: my-x509-credentials
mountPath: /var/run/my-x509-credentials
volumes:
- name: my-x509-credentials
projected:
defaultMode: 0644
sources:
- podCertificate:
signerName: coolcert.example.com/foo
keyType: ED25519
credentialBundlePath: credentialbundle.pem
userAnnotations:
example.com/annotation1: value1
example.com/annotation2: value2
Field by field:
| Field | Meaning | Rules |
|---|---|---|
signerName | which signer should issue the certificate | required; a controller watching for that signer must exist, or the Pod never starts |
keyType | private key algorithm the kubelet generates | ED25519, ECDSAP256, ECDSAP384, ECDSAP521, RSA3072, RSA4096 |
maxExpirationSeconds | the longest certificate lifetime the Pod author accepts | default 86400 (24 h), minimum 3600 (1 h), maximum 7862400 (91 days); kubernetes.io signers are capped at 86400; the signer may issue shorter |
credentialBundlePath | one file holding key then chain | first PEM block is a PKCS#8 PRIVATE KEY, followed by CERTIFICATE blocks for the leaf and any intermediates |
keyPath, certificateChainPath | separate files for key and chain | optional alternative; see the mismatch warning below |
userAnnotations | opaque hints for the signer | keys must be domain-prefixed; copied verbatim into the request’s unverifiedUserAnnotations |
Three practical rules from the documentation:
- Prefer
credentialBundlePath. The kubelet rotates with symlink-based atomic writes, so a read sees either the old bundle or the new one, never a mix. If you split the key and chain into two files, a rotation between your two reads can hand you a key that does not match the certificate. - The application must reload. The kubelet refreshes the key and chain as they approach expiration, but it cannot make your process notice. Use inotify or periodic re-reads. A service that loads the bundle once at startup will fail its TLS handshakes after the first rotation.
subPathkills updates. As with every projected source, a container that mounts the projected volume viasubPathdoes not receive updates. Mount the directory.
The userAnnotations field deserves a security note. Whatever a Pod author puts there arrives at the signer labelled unverifiedUserAnnotations, and the documentation is explicit that signers must not trust it without verification and should deny requests containing keys they do not recognise. It is a way to ask for, say, a specific SAN; it is never a way to prove entitlement to one.
The PodCertificateRequest lifecycle
Here is what happens between the Pod being scheduled and the file appearing, in the order the KEP and the API documentation describe it:
- The kubelet generates a key pair for each
podCertificatesource, of the requestedkeyType. The private key stays in kubelet memory and on the node’s filesystem for that Pod. - The kubelet builds a stub PKCS#10 CSR, signs it with the new key, and creates a PodCertificateRequest in the Pod’s namespace. The request names the Pod, its UID, the ServiceAccount and its UID, the Node and its UID, the signer, the maximum expiration, and the CSR. The API server verifies the CSR signature during admission, which is the proof of possession: the requester demonstrably holds the private key for the public key being certified. Kubelet-generated CSRs are completely empty apart from the key; signers extract the public key and ignore anything else.
- The signer’s controller watches for requests with its
signerName, decides, and writes the result tostatus: either acertificateChainwithnotBefore,notAfter, andbeginRefreshAt, marked by anIssuedcondition, or aDeniedorFailedcondition with no chain. - The kubelet writes the credential bundle into the projected volume (private key first, then the chain) and the container starts. If the request was denied or failed, volume setup fails and the Pod does not start.
- At
beginRefreshAt, the kubelet starts over: new key, new request, new bundle, swapped in atomically. The KEP adds up to five minutes of jitter so a fleet does not stampede its signer. Errors during refresh are logged but not surfaced while the current certificate is still valid; once it expires, they become volume-setup errors.
Notice what is missing compared with the CertificateSigningRequest flow you know from kubelet bootstrapping: there is no approval phase. A CSR must be approved (kubectl certificate approve or an auto-approver) before a signer may sign it. A PodCertificateRequest goes straight from creation to the signer, which issues, denies, or fails it directly. The exam-relevant consequence: if a Pod is waiting on a certificate, approving something will never unblock it. You either need a working signer controller for that signerName, or you need to read the Denied/Failed condition it already wrote.
The spec, with validation rules
| Field | Required | Rule |
|---|---|---|
signerName | yes | names beginning kubernetes.io are reserved; the documented well-known value kubernetes.io/kube-apiserver-client-pod is “currently unimplemented” |
podName, podUID | yes | must match an existing Pod |
serviceAccountName, serviceAccountUID | yes | the Pod’s ServiceAccount |
nodeName, nodeUID | yes | the node the Pod is bound to |
maxExpirationSeconds | no, default 86400 | API server rejects under 3600; maximum 7862400; kubernetes.io signers never exceed 86400 |
stubPKCS10Request | yes | DER PKCS#10; signature verified at admission; key must be one of RSA3072, RSA4096, ECDSAP256, ECDSAP384, ECDSAP521, ED25519 (the API type definition also lists the post-quantum MLDSA44, MLDSA65 and MLDSA87 as allowed key types, which kubelet does not yet generate) |
unverifiedUserAnnotations | no | domain-prefixed keys, size-limited values; copied from the volume’s userAnnotations |
The whole spec is immutable after creation. You cannot edit a request to change the signer or the lifetime; the kubelet creates a fresh one at refresh time.
The status, with its three mutually exclusive conditions
| Condition | Meaning | Kubelet reaction |
|---|---|---|
Issued | the certificate was issued; certificateChain, notBefore, notAfter, beginRefreshAt are set | writes the bundle, schedules refresh |
Denied | the signer refused; reasons include UnsupportedKeyType and InvalidUnverifiedUserAnnotations | treated as fatal for volume setup; the Pod does not start; retrying is assumed not to change the outcome |
Failed | the signer tried and could not issue | treated as a permanent error for that Pod; a higher-level controller is expected to create a new Pod |
Exactly one of the three may be present, each must have status "True", and once any of them is set the whole status becomes immutable. A signer that wants to change its mind cannot; it waits for the kubelet’s next request.
Further status rules: certificateChain must be one or more PEM-wrapped DER certificates, with the first block being the issued certificate and the rest intermediates (unless the signer documents otherwise); notBefore and notAfter must match the leaf certificate exactly; beginRefreshAt is a hint and the kubelet may refresh earlier or later. When the kubelet projects the chain, it drops any data between PEM blocks and any PEM headers.
Finally, garbage collection: a kube-controller-manager controller deletes PodCertificateRequests older than 15 minutes. They are not meant to be a durable record. If you kubectl get podcertificaterequests and see nothing, that does not mean nothing happened; it may mean it happened more than fifteen minutes ago. The Pod’s events are the durable breadcrumb.
Who may do what: Node authorizer, NodeRestriction, and signer RBAC
This is the Cluster Hardening heart of the topic, and the part most likely to appear as an RBAC question.
The kubelet creates requests as system:node:<nodeName>, a member of system:nodes. The documentation says nodes “get permission to create and read PodCertificateRequests related to them, based on spec.nodeName”. With the NodeRestriction admission plugin enabled (which every hardened cluster and every exam cluster has), a node “can only create requests for real pods running on that node”. The KEP spells out the checks: the namespace, Pod name and UID, ServiceAccount name and UID, and Node name and UID must all match an existing Pod; that Pod must be scheduled to the named node; the Pod must be in Pending or Running; and the request must be created by system:node:<nodeName> for that same node. A compromised kubelet therefore cannot mint certificates for Pods on other nodes, or for Pods that do not exist.
The signer’s controller needs two permissions:
updateonpodcertificaterequests/statusincertificates.k8s.io, to write the chain or the condition.- The custom verb
signon thesignersresource, withresourceNameset to its signer, as<domain>/<path>for one signer or<domain>/*for every signer under a domain.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: coolcert-signer
rules:
- apiGroups: ["certificates.k8s.io"]
resources: ["podcertificaterequests"]
verbs: ["get", "list", "watch"]
- apiGroups: ["certificates.k8s.io"]
resources: ["podcertificaterequests/status"]
verbs: ["update"]
- apiGroups: ["certificates.k8s.io"]
resources: ["signers"]
resourceNames: ["coolcert.example.com/foo"]
verbs: ["sign"]
The sign verb is the same one CSR signers use, so if you have read our kube-apiserver authentication internals post or the RBAC privilege-escalation post, the pattern is familiar: a resource that exists only to hang custom verbs on, scoped by resourceNames. Granting sign on signers with no resourceNames, or with a wildcard domain you do not own, is a privilege-escalation path: whoever holds it can issue certificates in any signer’s name.
Nobody approves. There is no approve verb in play for pod certificates, no certificatesigningrequests/approval subresource. If a scenario offers “grant the controller the approve verb” as a fix, it is a distractor.
ClusterTrustBundle: distributing the other half of TLS
A certificate is only useful if the peer trusts the CA that signed it. ClusterTrustBundle is the API for that. It is cluster-scoped, holds one or more CA certificates in PEM, and is designed to be “world-readable within the cluster”: with RBAC, every ServiceAccount gets get, list, and watch on ClusterTrustBundles by default. The documentation adds a nuance worth remembering: because any ServiceAccount can read them, a user with only namespace-level access can still read bundles by impersonating a ServiceAccount they control. Do not put anything secret in one; CA certificates are public by nature.
apiVersion: certificates.k8s.io/v1
kind: ClusterTrustBundle
metadata:
name: example.com:mysigner:prod
spec:
signerName: example.com/mysigner
trustBundle: |
-----BEGIN CERTIFICATE-----
MIIB...
-----END CERTIFICATE-----
Rules on trustBundle: only PEM CERTIFICATE blocks, each parsing as a valid X.509 certificate, each with the basic-constraints extension and the CA bit set. The API server rejects duplicates and PEM block headers. Consumers (including the kubelet) may reorder, deduplicate, and strip headers, so never rely on order.
Signer-linked versus unlinked bundles
| Signer-linked | Signer-unlinked | |
|---|---|---|
spec.signerName | set, e.g. example.com/mysigner | empty |
| Naming rule | name must start with the signer name with / replaced by :, then :, then a suffix: example.com:mysigner:prod | name must not contain a colon |
| Who may create or update | needs the custom verb attest on signers for that signer name (<domain>/<path> or <domain>/*) | ordinary RBAC on clustertrustbundles, no attest |
| Purpose | ”these are the trust anchors for certificates issued by this signer”, asserted by someone authorised to speak for the signer | arbitrary CA distribution, e.g. your corporate root for outbound calls |
| Selectable by | spec.signerName field selector, labels | name, labels |
The attest verb is the mirror image of sign. sign means “I may issue certificates in this signer’s name”; attest means “I may declare which CAs this signer’s certificates chain to”. Separating them lets you run the issuing controller and the trust publisher as different identities, and a scenario where “the ServiceAccount can read bundles but gets Forbidden creating example.com:mysigner:foo” is asking you to add attest, not create.
Multiple bundles may exist per signer, which is how you rotate a CA: publish a bundle containing both old and new roots, roll certificates, then publish one with only the new root.
The clusterTrustBundle projected volume
Workloads consume bundles through a projected source, selected either by name or by signer plus optional label selector:
volumes:
- name: token-vol
projected:
sources:
- clusterTrustBundle:
name: example
path: example-roots.pem
- clusterTrustBundle:
signerName: "example.com/mysigner"
labelSelector:
matchLabels:
version: live
path: mysigner-roots.pem
optional: true
Behaviour you can be asked about:
- With
signerNameand nolabelSelector, all bundles for that signer are selected and merged. - The kubelet deduplicates certificates, normalises the PEM (drops comments and headers), reorders, writes to
path, and keeps the file current as bundles change. - By default, the Pod will not start if the named bundle does not exist or the signer-and-selector matches nothing.
optional: truelets it start with an empty file atpath. A Pod stuck because an operator has not yet published a bundle is this rule in action. - The same
subPathcaveat applies: no updates through asubPathmount.
The bundle the control plane publishes for you
The ClusterTrustBundle feature gate also enables a controller in kube-controller-manager that publishes a bundle for the built-in kubernetes.io/kube-apiserver-serving signer. From the publisher’s source, the object is named by replacing / with : in the signer name, appending :, and then a hex hash of the bundle contents, so you will see something like kubernetes.io:kube-apiserver-serving:3f2a... (24 hex characters). On each reconcile it creates or updates the bundle for the current CA content and deletes any other bundle for that signer whose name does not match, so a CA rotation produces a new object and removes the old one.
What is this signer for? The certificate-signing-requests documentation describes kubernetes.io/kube-apiserver-serving as the signer for “certificates used to verify kube-apiserver serving certificates”. Signing and approval for it happen outside kube-controller-manager, in the cluster administrator’s own PKI; the controller manager only publishes the trust. Certificates issued under it must carry at least one DNS or IP SAN pointing at the API server, the recommended maximum lifetime is 30 days, and CA certificates should not be issued from it. In practice this gives in-cluster clients a Kubernetes-native way to learn the API server’s CA without reading ca.crt out of a ServiceAccount token volume or a kubeconfig.
Pod certificates compared with what you already use
| Projected ServiceAccount token | Pod certificate | Service-mesh workload cert (SVID) | TLS Secret mounted in Pod | |
|---|---|---|---|---|
| Credential type | bearer JWT | X.509 certificate plus private key | X.509 (SPIFFE URI SAN) | X.509 |
| Who generates the key | nobody; token is a signed assertion | kubelet, on the node; key never leaves | mesh agent or sidecar on the node | you, out of band |
| Request object | TokenRequest subresource (kubelet or client) | PodCertificateRequest (kubelet only) | mesh-specific, often no Kubernetes object | none |
| Approval | none | none; signer issues or denies directly | mesh CA decides | n/a |
| Node binding enforced by API server | yes (TokenRequest from kubelet) | yes (NodeRestriction on the request) | depends on the mesh | no |
| Default lifetime | 1 hour, minimum 600 s | 24 hours default; 1 hour to 91 days; kubernetes.io signers cap at 24 h | often 24 h or less | until you rotate it |
| Rotation | kubelet re-requests before expiry | kubelet re-keys and re-requests at beginRefreshAt | mesh agent | manual or a controller |
| Audience / peer check | aud claim, validated by TokenReview or the recipient | TLS handshake against a trust bundle | mesh trust domain | whatever CA you configured |
| Good for | calling the API server, calling services that validate JWTs | mTLS, client certs for external systems, PKCS#10 CAs | zero-config mTLS between meshed services | legacy fixed certificates |
| Native trust distribution | ca.crt in the token volume | clusterTrustBundle projection | mesh control plane | you mount the CA too |
Three comparisons the exam can draw out of this table:
- Pod certificates do not replace ServiceAccount tokens for talking to the API server. The reserved signer for that purpose,
kubernetes.io/kube-apiserver-client-pod, is documented but unimplemented on 1.37. Today a Pod still authenticates to kube-apiserver with its token. Our ServiceAccount token security post remains the reference for that side. - Pod certificates are a primitive, not a mesh. They give you a rotated key pair and chain in a file; they do not give you policy, traffic capture, or identity-aware routing. Cilium’s transparent encryption encrypts at the network layer with no application involvement; a mesh does mTLS with sidecars or ambient proxies; pod certificates let your application do mTLS itself, with a signer of your choosing. The minimize-microservice-vulnerabilities post covers the mTLS decision space.
- Pod certificates versus TLS Secrets. A Secret holds a static key that every reader of the Secret can copy and that someone must rotate. A pod certificate’s key is generated per Pod, bound to that Pod, rotated automatically, and never stored in etcd. For an Ingress controller’s serving certificate, Secrets (ideally managed by a controller) are still the norm, as in our Ingress TLS post; for a workload’s own identity, pod certificates are the stronger design.
Diagnosing pod-certificate and trust-bundle problems
| Symptom | Likely cause | What to check |
|---|---|---|
Pod stuck ContainerCreating, events mention PodCertificateRequest | no controller handles that signerName, or request denied/failed | kubectl get podcertificaterequests -n <ns>; kubectl describe the request and read status.conditions |
Condition Denied, reason UnsupportedKeyType | signer does not support the keyType you asked for | change keyType in the volume; the signer may suggest one in the message |
Condition Denied, reason InvalidUnverifiedUserAnnotations | signer rejected an annotation key it does not recognise | remove or correct userAnnotations |
Condition Failed | signer error (CA unreachable, policy) | fix the signer; recreate the Pod; the kubelet treats Failed as permanent for that Pod |
| Request created but never answered | signer controller down, or lacks sign / podcertificaterequests/status update | signer logs; kubectl auth can-i sign signers --as=system:serviceaccount:... |
Request creation itself is Forbidden | the creator is not the node the Pod runs on, or the Pod fields do not match a real Pod | only kubelets create these; NodeRestriction rejects mismatches |
| No requests visible for a Pod that is running fine | garbage collected after 15 minutes | normal; read Pod events instead |
| Certificate rotated but app still presents the old one | app loaded the file once | reload on change (inotify or periodic); use credentialBundlePath |
| Key and certificate do not match after rotation | separate keyPath and certificateChainPath read at different moments | switch to credentialBundlePath |
| Mounted bundle file never updates | subPath mount of the projected volume | mount the directory |
| Pod will not start, event says ClusterTrustBundle not found | named bundle missing, or signer plus selector matches nothing | create the bundle or set optional: true |
Creating example.com:mysigner:foo is Forbidden despite create on clustertrustbundles | missing attest on signers for example.com/mysigner | add the attest rule with resourceNames |
Creating a bundle named with a colon and no signerName fails | unlinked bundle names may not contain : | rename, or set signerName and get attest |
| Bundle creation rejected with a certificate error | a certificate lacks the CA bit, or duplicates/headers present | fix the PEM; CA certs only |
maxExpirationSeconds: 1800 rejected | minimum is 3600 | use 3600 or more |
Asked for 7 days from a kubernetes.io signer, got 24 hours | reserved signers cap at 86400 | expected; use your own signer for longer lifetimes |
Hands-on: see every object on a 1.37 cluster in ten minutes
You need a 1.37 cluster with NodeRestriction enabled (kind and kubeadm both qualify) and openssl.
Step 1: confirm the APIs are served as v1.
kubectl api-resources --api-group=certificates.k8s.io
kubectl explain podcertificaterequest.spec | head -40
kubectl explain clustertrustbundle.spec
You should see certificatesigningrequests, clustertrustbundles, and podcertificaterequests, all certificates.k8s.io/v1. Note from explain that maxExpirationSeconds documents the 3600 to 7862400 range and the 86400 cap for kubernetes.io signers.
Step 2: look at the bundle the control plane already published.
kubectl get clustertrustbundles
kubectl get clustertrustbundles --field-selector spec.signerName=kubernetes.io/kube-apiserver-serving -o yaml
Decode the certificate to see the cluster CA:
kubectl get clustertrustbundles -o jsonpath='{.items[0].spec.trustBundle}' | openssl x509 -noout -subject -issuer -dates
Step 3: create an unlinked bundle with your own CA and project it.
openssl req -x509 -newkey ec -pkeyopt ec_paramgen_curve:P-256 -nodes \
-keyout corp-ca.key -out corp-ca.crt -days 30 -subj "/CN=corp-root"
kubectl apply -f - <<EOF
apiVersion: certificates.k8s.io/v1
kind: ClusterTrustBundle
metadata:
name: corp-root
spec:
trustBundle: |
$(sed 's/^/ /' corp-ca.crt)
EOF
Now a Pod that mounts it:
kubectl apply -f - <<'EOF'
apiVersion: v1
kind: Pod
metadata:
name: ctb-reader
spec:
containers:
- name: c
image: busybox
command: ["sleep", "3600"]
volumeMounts:
- name: roots
mountPath: /roots
readOnly: true
volumes:
- name: roots
projected:
sources:
- clusterTrustBundle:
name: corp-root
path: corp.pem
- clusterTrustBundle:
signerName: kubernetes.io/kube-apiserver-serving
path: apiserver.pem
optional: true
EOF
kubectl exec ctb-reader -- ls -l /roots
kubectl exec ctb-reader -- head -3 /roots/corp.pem
Delete corp-root and watch /roots/corp.pem disappear on the next kubelet sync; then try creating a Pod that selects it by name without optional: true and observe that it stays ContainerCreating with a clear event.
Step 4: feel the attest verb.
kubectl create serviceaccount publisher
kubectl create clusterrole ctb-writer --verb=create,update,get,list --resource=clustertrustbundles
kubectl create clusterrolebinding publisher-ctb --clusterrole=ctb-writer --serviceaccount=default:publisher
kubectl --as=system:serviceaccount:default:publisher apply -f - <<EOF
apiVersion: certificates.k8s.io/v1
kind: ClusterTrustBundle
metadata:
name: example.com:mysigner:v1
spec:
signerName: example.com/mysigner
trustBundle: |
$(sed 's/^/ /' corp-ca.crt)
EOF
Forbidden, even though the ServiceAccount may create ClusterTrustBundles. Add the attestation right and retry:
kubectl create clusterrole mysigner-attest --verb=attest --resource=signers --resource-name=example.com/mysigner
kubectl create clusterrolebinding publisher-attest --clusterrole=mysigner-attest --serviceaccount=default:publisher
# re-run the apply above: it now succeeds
Then try the same signer-linked spec with the name wrongname (it fails the naming rule) and an unlinked spec with a colon in the name (it fails too). Those two errors are the naming rules made concrete.
Step 5: watch a PodCertificateRequest get created and go nowhere.
Deploy the podcertificate-pod manifest from earlier, with signerName: coolcert.example.com/foo, a signer nobody runs:
kubectl get pod podcertificate-pod # stays ContainerCreating
kubectl get podcertificaterequests -o wide
kubectl get podcertificaterequests -o yaml | grep -A3 -E 'nodeName|podName|signerName|maxExpirationSeconds|conditions'
kubectl describe pod podcertificate-pod | tail -15
You will see a request with the Pod’s name and UID, the node’s name and UID, the ServiceAccount, maxExpirationSeconds: 86400, a base64 stubPKCS10Request, and an empty status. Decode the CSR to prove it is empty apart from the key:
kubectl get podcertificaterequests -o jsonpath='{.items[0].spec.stubPKCS10Request}' \
| base64 -d | openssl req -inform DER -noout -text | head -20
Wait fifteen minutes and list again: the controller manager has deleted it, and the kubelet has created a new one. Delete the Pod when done.
Step 6: prove that you cannot forge a request.
Save one of the kubelet’s requests to a file, change podName to something that does not exist, strip status and resourceVersion, and try to create it as yourself. The API server rejects it: a PodCertificateRequest must be created by system:node:<nodeName> for a real Pod bound to that node. This is the node-binding guarantee from the KEP, and it is why a signer can trust the Pod identity in spec without checking it again.
Step 7: compare against a projected token, side by side.
Add a serviceAccountToken source with expirationSeconds: 3600 and audience: my-service to the same projected volume as a podCertificate source, and look at the two files. One is a JWT you could paste into a header; the other is a key you must never paste anywhere plus a chain you may show to anyone. That contrast is the whole motivation for the feature.
If you want to go one step further and actually see a certificate issued, the Kubernetes project’s mesh-examples repository contains a reference signer that handles PodCertificateRequests for a demo signer name; running it against this Pod turns step 5’s empty status into an Issued chain you can decode with openssl.
Scenario drill: cue to answer
| Cue in the question | Answer |
|---|---|
| Pod needs an X.509 identity for mTLS with no mesh | podCertificate projected volume with a signer your cluster runs |
| Where is the private key generated and stored? | By the kubelet, on the node; it never leaves the node; only the stub CSR travels |
| How is possession of the key proven? | The kubelet signs the stub PKCS#10 CSR; the API server verifies the signature at admission |
| Who approves a PodCertificateRequest? | Nobody; there is no approval phase; the signer issues, denies, or fails directly |
kubectl certificate approve on a pod certificate | Does not apply; distractor |
| Default, minimum, maximum certificate lifetime | 86400 s default; 3600 s minimum; 7862400 s (91 days) maximum; kubernetes.io signers cap at 86400 |
Signer denied with UnsupportedKeyType | Change the volume’s keyType; six supported types |
Request shows Failed; Pod still waiting | Failed is permanent for that Pod; recreate the Pod after fixing the signer |
| Which RBAC does a signer controller need? | update on podcertificaterequests/status and sign on signers with resourceNames |
| Which RBAC does a trust-bundle publisher need for a signer-linked bundle? | attest on signers for that signer, plus normal access to clustertrustbundles |
sign on signers with no resourceNames | Over-privileged; can issue in any signer’s name; privilege escalation |
| Who may create a PodCertificateRequest? | The kubelet of the node the Pod is bound to, as system:node:<nodeName>, for a real Pod in Pending or Running |
| Compromised kubelet requests certs for Pods on other nodes | Rejected by NodeRestriction and the Node authorizer |
| Requests vanish after a while | kube-controller-manager deletes PodCertificateRequests older than 15 minutes |
| App keeps presenting an expired certificate | It never reloaded the rotated file; watch for changes |
| Key and certificate mismatch after rotation | Separate keyPath/certificateChainPath read non-atomically; use credentialBundlePath |
| Format of the credential bundle | PKCS#8 PRIVATE KEY block first, then CERTIFICATE blocks, leaf first |
| When does the kubelet renew? | At status.beginRefreshAt, with up to five minutes of jitter; new key each time |
Can a signer trust unverifiedUserAnnotations? | No; must verify, and should deny unknown keys |
| Distribute a CA to all workloads natively | ClusterTrustBundle plus clusterTrustBundle projected volume |
| Who can read ClusterTrustBundles? | Everyone in the cluster, effectively; all ServiceAccounts have get/list/watch by default; never store secrets in them |
Name for a bundle linked to example.com/mysigner | Must start example.com:mysigner: |
| Unlinked bundle name with a colon | Rejected; unlinked names may not contain : |
| Pod will not start, bundle missing | Default behaviour; set optional: true to start with an empty file |
| Select all bundles for a signer | signerName with no labelSelector |
| Bundle file not updating in container | subPath mount; mount the directory |
What publishes kubernetes.io:kube-apiserver-serving:...? | kube-controller-manager, when the ClusterTrustBundle gate is on (default in 1.37) |
| Pod authenticates to kube-apiserver with a pod certificate | Not yet; kubernetes.io/kube-apiserver-client-pod is reserved but unimplemented; use the ServiceAccount token |
pkixPublicKey in a manifest | Pre-1.36 beta field; v1 uses stubPKCS10Request |
| Cluster is 1.36 and pod certificates do not work | Gate was off by default in beta; GA and on by default from 1.37 |
| Pod certificates versus Cilium encryption | Cilium encrypts at the network layer transparently; pod certificates give the application its own identity for mTLS |
| Pod certificates versus a TLS Secret | Per-Pod key never in etcd, auto-rotated, node-bound, versus a static shared key you rotate yourself |
Mistakes that cost points
Looking for an approval step. There is none. Pod certificates are not CSRs. If a request sits unanswered, the signer is missing or broken, not unapproved.
Confusing sign and attest. sign is for issuing certificates (signer controllers). attest is for publishing signer-linked trust bundles. Both hang off the signers resource and both should be scoped with resourceNames.
Granting create on clustertrustbundles and expecting signer-linked creation to work. It needs attest for that signer as well.
Reading the key and chain from separate files. Rotation is atomic per file, not across files. Use the bundle path.
Loading the certificate once. The kubelet rotates; your process must notice.
Mounting projected sources with subPath. Updates stop.
Assuming a Pod can use a pod certificate to call the API server. The reserved signer is unimplemented in 1.37. ServiceAccount tokens remain the API-server credential.
Expecting requests to persist. Fifteen minutes, then garbage collected. Pod events are your audit trail.
Treating Failed as transient. The kubelet does not retry a failed request for that Pod. Recreate the Pod.
Putting secrets in a ClusterTrustBundle. They are world-readable by design.
Frequently Asked Questions
Are PodCertificateRequest and ClusterTrustBundle on the CKS?
Neither is named in the curriculum, but both are GA in Kubernetes 1.37, the version the exam uses, and both sit in the certificates.k8s.io API group alongside CertificateSigningRequests, which the curriculum does cover. They fit the Cluster Hardening (RBAC, service accounts, API access) and Minimize Microservice Vulnerabilities (pod-to-pod encryption, mTLS) domains. Know what each object is, who may create and sign it, and how it differs from CSRs and ServiceAccount tokens.
What is the difference between a PodCertificateRequest and a CertificateSigningRequest?
A CSR is a general-purpose request that any authenticated identity may create, that must be approved before a signer signs it, and that carries whatever subject the requester chose. A PodCertificateRequest is created only by the kubelet for a specific Pod on its own node, carries the Pod, ServiceAccount, and Node identity verified by the API server, has no approval phase, and is garbage collected after 15 minutes. CSRs are for node and user identities; PodCertificateRequests are for workload identities.
Does a pod certificate replace the ServiceAccount token?
Not in 1.37. The API server does not yet accept pod certificates as client credentials; the reserved signer name kubernetes.io/kube-apiserver-client-pod is documented as unimplemented. Pod certificates are for your workloads to authenticate to each other and to external systems. The ServiceAccount token remains the credential for the Kubernetes API.
How long does a pod certificate live?
Whatever the signer issues, bounded by the Pod’s maxExpirationSeconds: default 24 hours, minimum 1 hour, maximum 91 days. Signers under the reserved kubernetes.io prefix never issue longer than 24 hours. The kubelet begins renewing at the beginRefreshAt time the signer sets, generating a fresh key pair each time.
What happens if the signer denies the request?
The kubelet treats Denied as fatal for volume setup and the Pod does not start. The two documented reasons are UnsupportedKeyType (pick a different keyType) and InvalidUnverifiedUserAnnotations (fix or remove userAnnotations). A Failed condition is treated the same way for that Pod; the fix is to repair the signer and create a new Pod.
Who can read a ClusterTrustBundle?
Effectively everyone in the cluster. With RBAC, every ServiceAccount has get, list, and watch on ClusterTrustBundles by default, and the documentation says to treat them as world-readable. They are meant to hold public CA certificates only.
What is the attest verb?
A custom RBAC verb on the signers resource in certificates.k8s.io. Holding attest for a signer name lets you create or update signer-linked ClusterTrustBundles for that signer, which are named <domain>:<path>:<suffix>. It is distinct from sign, which lets a controller issue certificates for the signer.
Why does my Pod not start when a bundle is missing?
By default a clusterTrustBundle projected source blocks Pod start if the named bundle does not exist or the signer-and-label selection matches nothing. Set optional: true on that source to start with an empty file instead.
Is this the same as SPIFFE?
Pod certificates are a primitive that a SPIFFE-style system could use: a per-workload key pair, node-bound issuance, automatic rotation. Kubernetes does not define SPIFFE identifiers or a trust domain itself; a signer you deploy decides what SANs to issue. Service meshes continue to issue their own SVIDs, and may adopt PodCertificateRequests as their issuance path over time.
How should I practise this for the exam?
Run the lab above on a 1.37 cluster until kubectl get podcertificaterequests, the attest Forbidden error, and the signer-linked naming rule are things you have seen rather than read about. Then practise it under exam conditions. The CKS mock exam bundle runs performance-based scenarios on real clusters in a remote-desktop environment that mirrors the exam, including RBAC and certificate tasks where you have to find the missing verb or the misnamed object against the clock. Pair it with our CKS practice environment guide for setting up a free local cluster that matches the exam version.
Conclusion
Kubernetes 1.37 gives every Pod the option of a real X.509 identity. The kubelet generates the key on the node and never lets it leave, proves possession with a stub PKCS#10 CSR that the API server verifies, and creates a PodCertificateRequest that NodeRestriction binds to a real Pod on that node. A signer with update on the status subresource and sign on its signer name issues, denies, or fails the request directly, with no approval step, and the kubelet writes a PEM credential bundle it will rotate at beginRefreshAt. ClusterTrustBundles carry the matching CA certificates to every workload through the clusterTrustBundle projection, with the attest verb guarding who may speak for a signer and strict naming rules telling linked bundles from unlinked ones. The reserved pod signer for the API server is not implemented yet, so ServiceAccount tokens stay where they are; everything else that used to need a mesh, a sidecar, or a static Secret now has a native path.
For the CKS, the payoff is recognising these objects when they appear in an RBAC task or a stuck-Pod scenario, knowing the two custom verbs and which one each actor needs, and being able to say precisely why a Pod with a pod certificate is in a stronger position than a Pod with a mounted TLS Secret.