Certificates and workload federation
Certificates establish trust, not permissions
A certificate associates a public key with an identity under a signer’s rules. A relying party checks the certificate chain against trusted roots, its validity period, appropriate usage and the expected identity. For TLS servers the expected DNS name must match the certificate. Private keys remain private. A certificate can authenticate a client without granting it authorization to a Kubernetes resource.
trusted CA → intermediate (if used) → leaf certificate → expected identityCertificateSigningRequest lifecycle
The Kubernetes certificates.k8s.io/v1 CertificateSigningRequest is cluster-scoped. It contains a request, a signerName and requested usages. An approval decision and certificate issuance are distinct steps; approval alone does not create a certificate. A signer checks its own policy and may decline issuance. The issued certificate, when available, appears in status.certificate. The client must still install and use it correctly. This example is a conceptual state timeline, not a CSR payload.
request submitted → policy review → approved → signer issues → certificate installedExpiry and renewal windows
Consider a fictional certificate valid from 2026-01-01T00:00Z until 2026-04-01T00:00Z. A 30-day lead places the planned renewal at 2026-03-02T00:00Z. An expired certificate is not repaired by restarting a Pod. Renew before expiration, check the new chain and identity, and verify that the application actually serves the new certificate. Issuer outages require alerting before the remaining validity becomes critical. Exact issued lifetimes may differ from requests.
notBefore: 2026-01-01T00:00Zrenewal target: 2026-03-02T00:00ZnotAfter: 2026-04-01T00:00ZShort-lived workload federation
Instead of storing a long-lived cloud access key, a workload can present an audience-bound ServiceAccount token to a compatible external identity provider. The provider verifies signature, issuer, audience, validity and the configured subject-to-role trust relationship, then issues its own scoped credential if policy allows. Kubernetes tokens are not automatically accepted by every provider. An audience is the intended recipient, not a permission grant. Provider-specific setup and revocation semantics need separate verification.
serviceAccountName: catalogautomountServiceAccountToken: falsevolumes:- name: identity projected: sources: - serviceAccountToken: audience: inventory.example.invalid expirationSeconds: 3600 path: tokencontainers:- name: catalog image: registry.example.invalid/catalog:fixture volumeMounts: - name: identity mountPath: /var/run/lab-identity readOnly: trueToken renewal and least privilege
The Pod fragment above disables automatic mounting of the default API token and explicitly projects a separate token for the fictional inventory audience. Kubelet refreshes projected ServiceAccount tokens; applications must reread the file instead of caching an expiring token indefinitely. The requested expiration is not a promise of exact lifetime; inspect issued metadata in an approved test without logging the token. The service account and issuer trust must exist. No real token is included.
projected token file → verified external issuer trust → scoped temporary credentialPractice: distinguish failures
Use the synthetic certificate and token metadata in cases.json. Identify a certificate outside its validity window, a wrong audience and an unexpected subject. A metadata match is necessary but not sufficient: the model does not check signatures or revocation, nor does it validate a certificate chain. A real verification failure should be corrected at the trust or identity boundary, never by disabling verification.
lab-fixtures/secret-identity/cases.jsonCheck Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Certificates and workload federation — knowledge check
Interpret synthetic credential and trust evidence.
What does CSR approval guarantee?
What does an audience identify?
What must a relying party check beyond token metadata?
How should an application consume a rotating projected token?
What should a service do when its certificate nears expiry?