fix: rollout restart to avoid stale pod spec on redeploying with manifests#141
Merged
vigneshrajsb merged 1 commit intomainfrom Mar 24, 2026
Merged
fix: rollout restart to avoid stale pod spec on redeploying with manifests#141vigneshrajsb merged 1 commit intomainfrom
vigneshrajsb merged 1 commit intomainfrom
Conversation
vmelikyan
approved these changes
Mar 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a
kubectl rollout restartafterkubectl applyin the manifest deploy job.Problem
When redeploying a manifest service (e.g. after nuking and recreating a dependency like a database),
kubectl applyis a no-op at the pod level if the pod template spec hasn't changed — same image, same env vars. Kubernetes sees the existing ReplicaSet already satisfies the desired state and skips pod replacement entirely.This is a problem when the pod template is unchanged but a dependency has changed — specifically, init containers that seed or migrate a database never re-run because no new pod is ever created.
Fix
After
kubectl apply, if the deployment exists, unconditionally runkubectl rollout restartbefore waiting onkubectl rollout status. This patches therestartedAtannotation on the pod template, guaranteeing new pods are always created and init containers always execute on every manifest deploy.If the pod template spec did change (new image, new env), this results in a second rolling update — harmless, just slightly redundant.
Test plan