-
Notifications
You must be signed in to change notification settings - Fork 40k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kubectl rolling-update support for same image #24645
Conversation
ref #23516. This handles that use case safely. |
@@ -262,6 +275,7 @@ func RunRollingUpdate(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, arg | |||
if err != nil { | |||
return err | |||
} | |||
oldHash += "-orig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe give a comment here on why adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Suggest adding a test for this. |
Is there a plan to support the same behavior in deployments as well? |
Added test. @nikhiljindal, AFAIK, same-image rolling updates are not being supported in deployments. See #23497 (comment) |
friendly ping |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 9b91750. |
Automatic merge from submit-queue |
@jlowdermilk Please ping once the flaky test issue has been resolved and I'll re-evaluate the cherry pick status. |
…24645-upstream-release-1.2 Automated cherry pick of #24645
Commit found in the "release-1.2" branch appears to be this PR. Removing the "cherrypick-candidate" label. If this is an error find help to get your PR picked. |
@@ -78,6 +78,7 @@ kubectl rolling-update frontend-v1 frontend-v2 --rollback | |||
--dry-run[=false]: If true, print out the changes that would be made, but don't actually make them. | |||
-f, --filename=[]: Filename or URL to file to use to create the new replication controller. | |||
--image="": Image to use for upgrading the replication controller. Must be distinct from the existing image (either new image or new image tag). Can not be used with --filename/-f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jlowdermilk : I am confused. Does it still need to be distinct? I thought the point of this PR was to allow rolling-updates of the "same" (e.g. non-distinct) image so long as --image-pull-policy=always
(as noted below). Should it instead read "Must be distinct from the existing image (either new image or new image tag) unless the --image-pull-policy=always
argument is passed."
…-pick-of-#24645-upstream-release-1.2 Automated cherry pick of kubernetes#24645
…-pick-of-#24645-upstream-release-1.2 Automated cherry pick of kubernetes#24645
Fixes #23497.
Enables
kubectl rolling-update --image
to the same image, adding a--image-pull-policy
flag to remove ambiguity. This allows rolling-update to behave as an "update and/or restart" (#23497 (comment)), or as a forced update when the same tag can mean multiple versions (e.g.:latest
). cc @janetkuo @nikhiljindal