A Kubernetes Secret is not encrypted in the API server's backing store merely because its data field is base64 encoded. API data encryption at rest must be configured for the relevant resource. With an external KMS provider, availability of the key service and old decryption keys becomes part of cluster restore. Changing the first encryption provider or key affects new writes; previously stored objects need a controlled rewrite before an old key can be retired.
Kubernetes Secret encryption: rotate keys without losing restore access
Operational decision
A platform team rotates the key used to protect receipt-service Secrets. First inventory control-plane instances, the encryption configuration they actually run, the KMS provider's health, backup age, and the oldest restore point that remains in scope. Stage the new key while keeping the old decrypt path available, restart or reload the API servers according to the platform's supported procedure, and write a disposable Secret to prove new encryption. Re-encrypt existing Secret objects using a reviewed rewrite procedure and verify representative objects can be read after every control-plane instance has converged. Restore an encrypted backup into an isolated cluster with the keys needed by that backup; a successful current-cluster read alone does not prove restore. Retire the old key only when all live objects and retained backups that require it have expired or been migrated. The checklist below intentionally contains no key material.
Receipt cluster encryption rotation gates
New writes: verified under the intended active key
Existing objects: rewritten and read back
API servers: all use the reviewed provider order
KMS: available during reads and failover
Backup: isolated restore succeeds with retained decrypt keys
Old key: retired only after live and backup dependencies endCost and verification
Rewriting every encrypted object creates API and etcd load; schedule and throttle it rather than creating a control-plane incident. Keeping an old key longer expands key-management cost and exposure, yet deleting it early can make backups unreadable. Measure failed decrypt requests, KMS latency and errors, object rewrite progress, and restore success. Encryption at rest protects stored API data, not a Secret copied into a Pod environment, log, image, or unencrypted backup.
Common Mistakes
- Do not confuse base64 encoding with encryption.
- Do not remove the old decrypt key after verifying only a newly written Secret.
- Do not claim a backup is restorable until it has been read with its required keys.
Connected lessons
- DevOps: delivery, infrastructure, and reliable operations
- Secrets and configuration across the delivery path
- Encryption key rotation: keep old data decryptable during recovery
- Immutable backup retention: protect recovery copies from deletion
- etcd quorum: preserve a voting majority during maintenance
