-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Pass --recreate-pods to helm by default in dev mode #946
Conversation
Codecov Report
@@ Coverage Diff @@
## master #946 +/- ##
==========================================
+ Coverage 43.78% 43.82% +0.04%
==========================================
Files 63 63
Lines 2654 2656 +2
==========================================
+ Hits 1162 1164 +2
Misses 1370 1370
Partials 122 122
Continue to review full report at Codecov.
|
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.
@stevenjm Thank you for this contribution! Since this behavior is helm only, would it make sense to add an option to the helm deployer and make it the default?
I'm sure the code will be simpler too.
@dgageot Sure, that makes sense, and should be a straightforward change. I'll hopefully get some time tomorrow to implement it. |
Whoops, since there's now a new option in skaffold.yaml I should also update the relevant examples/documentation. Will push another version of this change a bit later. |
It is common in development to just rebuild a Docker image with the same tag, which will not trigger a rolling update of the deployment because the pod spec does not change. Passing --recreate-pods will forcibly terminate the running pods and allow new ones to be spawned with the new image.
@dgageot I've made the change you requested. I haven't made the default In an ideal world, I'd still like to have it on by default for |
@stevenjm Thanks! Maybe you could create a ticket to later have a default value based on the command (dev or run) |
It is common in development to just rebuild a Docker image with the same tag, which will not trigger a rolling update of the deployment because the pod spec does not change. Passing
--recreate-pods
will forcibly terminate the running pods and allow new ones to be spawned with the new image.This change only applies in dev mode because it would be harmful for production deployments, which should push an image with a new tag and allow the usual rolling update process to replace the old pods.
This change would resolve #289, without requiring an additional configuration option. (This behaviour can be disabled at runtime with
--recreate-pods=false
if needed for some reason.)For now, I have only added a test to verify that a helm deployment works if
recreatePods == true
. Developing a test for the behaviour of actually recreating pods would be a little more involved, and I'm not sure it's worth including in this PR.