TECHNOLOGY

Secret updated but credentials are still old: file rotation and reloading

In this article
THE QUICK TAKE

Secret rotation and application adoption are separate events. Kubernetes updates projected Secret files with eventual consistency, while subPath mounts exclude normal updates. A program reading once can retain old credentials even after successful projection.

Secret rotation and application adoption are separate events. Kubernetes updates projected Secret files with eventual consistency, while subPath mounts exclude normal updates. A program reading once can retain old credentials even after successful projection.

Find the actual credential source

Record Secret reference, namespace, volumeMount and application consumption mode. Check environment injection separately: changing the object does not replace a running process’s environment. Investigation needs versions, names and safe markers rather than full values. Keep Secret contents, environment dumps and authorization headers out of logs. Identify the receiving service and its overlap rules; revoking old access can occur independently of the Kubernetes update.

Official reference 1.

Inspect projection boundaries

Secret volumes update through kubelet watch, cache and synchronization, so API update and file replacement need not happen simultaneously. SubPath mounts do not receive automatic projection updates. Verify the new version through a safe supported indicator. Establish whether the application watches changes or caches credentials in memory. Watching one inode can differ from reopening the path after projection changes; follow the client’s documented reload pattern.

Official reference 2.

Examine staged rotation

Suppose a receiving service temporarily accepts old and new credentials. Update the Secret, reload the application, confirm new access and then revoke the old credential according to service policy. This sequence requires real overlap support at the receiver; it cannot be assumed for every service. Without overlap, design another controlled transition with an understood interruption rather than promising seamless rotation through Kubernetes alone.

EventSafe confirmation
Secret changedObject version and time
Projection updatedVerified nonsecret marker
Client reread credentialsReload event or new process
New access acceptedControl-operation result

Apply credentials through supported behavior

Test reload where the client supports it. If credentials are read only at startup, replace Pods through a managed rollout. Check whether that rollout requires unavailable spare GPU capacity. Confirm all relevant replicas before revoking old access, not merely one successful request. Do not bake the Secret into an image for convenience; doing so expands storage and couples sensitive data to an artifact distributed through a separate lifecycle.

Verify revocation and residue

After transition, confirm the expected rejection of old access on a test path and continued new access. Check logs for leaked values and clean temporary files through the intended procedure. Preserve object version, projection, application reload and upstream acceptance as distinct evidence. That is more precise than one “Secret updated” marker. Repeat after mount or client-library changes, since consumption can change without renaming the Kubernetes Secret. A successful object update alone must never be mistaken for complete credential migration.

Related operational reading: cloud gpu account team key rotation; hardware security.

← All articles