Kubernetes may refresh a projected Secret volume while an application keeps an old TLS context in memory. A process might reload on a signal, watch the file, accept a hot secret update, or require a restart. Existing connections often retain the security properties negotiated at their handshake until they close. A rotation plan must therefore test fresh handshakes and long-lived sessions separately, and it must know how the server behaves if certificate and key files are observed during a partial update.
Certificate reloads: distinguish file delivery from active TLS state
Operational decision
A dispatch gateway receives a renewed certificate in its mounted Secret. The team records the Secret generation and fingerprint, then opens a new connection to each Pod to inspect the certificate actually served. One Pod keeps the prior fingerprint because its runtime loaded the file only at startup; the deployment controller rolls that Pod with readiness and disruption limits rather than assuming volume refresh was enough. For a proxy with hot secret delivery, verify the update acknowledgement and a new handshake without forcing a restart. Keep an older streaming connection open during the change to learn whether it can continue, whether it reauthenticates, and when it is drained. If the old key is merely expiring, a bounded overlap may be acceptable; if it is compromised, old sessions and ticket-resumption behavior require a shorter containment window. Test mismatched key and certificate files in a disposable instance and require the listener to reject that state or retain last-known-good material. The release is complete only when the fraction of Pods serving the new fingerprint reaches the declared threshold and old-session policy has been met.
Dispatch TLS rotation proof
Secret generation: new key and leaf present
Each Pod: new handshake serves expected fingerprint
Reload path: signal, watch, hot update, or rolling restart
Existing stream: observed drain and reauthentication behavior
Failure test: mismatched key and leaf rejected safely
Exit: old fingerprint and session count below thresholdCost and verification
Polling P Pods for a fresh handshake is O(P); rolling restarts consume temporary capacity and can disrupt long streams. A hot reload saves restarts but needs its own failure and acknowledgement monitoring. Track Secret-to-serving delay, Pods with stale fingerprints, active old sessions, handshake errors, and restart-induced latency. Do not equate a new Secret resource with a successful user-facing rotation.
Common Mistakes
- Do not infer active certificate state from a changed Secret alone.
- Do not check only an existing TLS connection after rotation.
- Do not restart every Pod simultaneously to force a new context.
Connected lessons
- DevOps: delivery, infrastructure, and reliable operations
- Certificate renewal: verify the served certificate after issuance
- ConfigMap projection: prove when a running process sees a new value
- Graceful Pod shutdown: stop accepting work before exit
- HTTP/2 drain: let existing streams finish while new calls move away
