Skip to content

feat(helm): add recreate upgrade (rollback) strategy - #9836

Closed
invidian wants to merge 1 commit into
helm:mainfrom
invidian:rollback-recreate
Closed

invidian wants to merge 1 commit into
helm:mainfrom
invidian:rollback-recreate

Conversation

@invidian

Copy link
Copy Markdown

What this PR does / why we need it:

An additional optional flag --recreate can be passed on upgrade (or rollback) of a release.
In combination with the --force flag the following strategies are employed when updating a resource (which can be directly compared to kubectl):

helm kubectl action on 'invalid' or 'conflict'

upgrade apply PATCH fail

upgrade --force replace PUT fail

upgrade --recreate apply --force PATCH DELETE -> GET (poll) -> POST

upgrade --recreate --force replace --force DELETE -> GET (poll) -> POST fail

The 'on error' column should be interpreted as follows. The server responds with 'invalid' e.g. if a certain resource contains an immutable field, which cannot be patched or updated by a PUT. In theses cases it can be helpful to delete the resource and recreate it. Examples for theses cases are:

  • roleRef in RoleBinding
  • spec.clusterIP in Service
  • parameters in StorageClass

Closes #7082.
Closes #7431.
Replaces #7431.

Signed-off-by: Daniel Strobusch [email protected]

Special notes for your reviewer:

Re-submitting rebased #7431.

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

An additional optional flag --recreate can be passed on upgrade (or rollback) of a release.
In combination with the --force flag the following strategies are employed when updating a resource (which can be directly compared to kubectl):

helm                        kubectl          action                         on 'invalid' or 'conflict'
--------------------------------------------------------------------------------------------------------------

upgrade                     apply            PATCH                          fail

upgrade --force             replace          PUT                            fail

upgrade --recreate          apply --force    PATCH                          DELETE -> GET (poll) -> POST

upgrade --recreate --force  replace --force  DELETE -> GET (poll) ->  POST  fail

The 'on error' column should be interpreted as follows. The server responds with 'invalid' e.g. if a certain resource contains an immutable field, which cannot be patched or updated by a PUT. In theses cases it can be helpful to delete the resource and recreate it. Examples for theses cases are:

 * roleRef in RoleBinding
 * spec.clusterIP in Service
 * parameters in StorageClass

Closes helm#7082.

Signed-off-by: Daniel Strobusch <[email protected]>
@helm-bot helm-bot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Jun 19, 2021
@bacongobbler

Copy link
Copy Markdown
Member

A rebase will not address the concerns laid out in #7431. For that reason as well as the reasons laid out in #7431 (comment), I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

proposal: handle immutable resources on update

4 participants