Kubernetes · Arazzo Workflow
Kubernetes Rotate a Secret and Restart Its Consumers
Version 1.0.0
Inventory existing secrets, write the new credential, then roll the deployment that consumes it.
View Spec
View on GitHub
AutomationCloud NativeCNCFContainersDeploymentOpen SourceOrchestrationScalingArazzoWorkflows
Provider
Workflows
rotate-secret
Write a rotated Secret and roll the deployment that consumes it.
Inventories the namespace's secrets, creates the rotated Secret, reads the consuming deployment, and replaces it with a new rollout annotation to force a rolling restart so pods pick up the new value.
1
inventorySecrets
listNamespacedSecrets
List the namespace's secrets to record what exists before the rotation, which gives the run an auditable before state.
2
writeRotatedSecret
createNamespacedSecret
Write the rotated credential using stringData so plain-text values are encoded by the API server rather than by the caller.
3
readConsumer
getNamespacedDeployment
Read the deployment that consumes the secret and capture its resourceVersion so the restart write is concurrency-safe.
4
rollConsumer
replaceNamespacedDeployment
Replace the deployment with a changed pod-template annotation. The template change is what triggers the rolling restart; pods remount the secret and read the rotated value on start.