Skip to content
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

Proposal: helm upgrade --reuse-value #342

Open
jamsesso opened this issue Apr 19, 2024 · 0 comments
Open

Proposal: helm upgrade --reuse-value #342

jamsesso opened this issue Apr 19, 2024 · 0 comments

Comments

@jamsesso
Copy link

Hello Helm community and maintainers!

I would like to propose a new flag to the upgrade command, --reuse-value. Similarly to --reuse-values, --reuse-value would instead allow me to specify exactly which keys I want to be reused from the previous upgrade as opposed to reusing all values from the previous upgrade.

Problem

To illustrate the idea completely, consider the following values.yaml:

image:
  tag:
    stable: "v1"
    canary: "v1"
secretVersion: "1"

As expected, after the initial chart installation, helm get values [release] would return the values defined in that file. When doing an upgrade, it would be useful to be able to update only the image.tag.canary value, so I could do this:

$ helm upgrade [release] [chart] --reuse-values --set image.tag.canary=v2

...which gives me my desired outcome of deployed values:

$ helm get values [release]
image:
  tag:
    stable: "v1"
    canary: "v2"
secretVersion: "1"

However, if I made a change to my values.yaml (in source control) to update the secret version to "2" and push that through a pipeline which effectively runs:

$ helm upgrade [release] [chart] --reuse-values --set image.tag.canary=v2

...the output is not what I intended:

$ cat values.yaml
image:
  tag:
    stable: "v1"
    canary: "v1"
secretVersion: "2"

$ helm get values [release]
image:
  tag:
    stable: "v1"
    canary: "v2"
secretVersion: "1"

The core of the issue is that some values are "owned" by the pipeline (the latest image tag build) while others are intended to be "owned" by the values.yaml file itself in source control.

Proposal

Allow Helm users to define which values should be reused with a new --reuse-value list:

$ helm upgrade [release] [chart] --reuse-value image.tag.stable --set image.tag.canary=v2

This should produce the following:

$ helm get values [release]
image:
  tag:
    stable: "v1"
    canary: "v2"
secretVersion: "2"

Conclusion

Perhaps it is not a correct approach to manage source-control owned configuration in a values.yaml file. I am open to suggestions here. In chart implementations I have seen (which are few - I am a new Helm user 👋), this is the case. Because of the behavior of --reuse-values, it seems too dangerous for use in an automated pipeline.

Thank you in advance for reading and for any discussion points!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant