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
Add 'helm install --app-version' command/versioning a chart against an app version #3555
Comments
I just ran into this as well. I normally want the image tag to be specified at time of packaging the chart, but for debugging the app wanted to do an install with a different tag. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Bringing this up again as it was raised in helm/charts#5919 Copying over parts of my recent comment: We specifically choose to keep the minor version of our chart aligned with the minor application version (although patch version numbers can, and do drift apart). This is because we may add a new flag to a new release of cert-manager, and by adding support for it into the Helm chart would break compatibility with older releases of cert-manager, as they do not support the flag. This is a pretty fundamental question around Helm chart versioning in general IMO, and one we don't have a good story for. I know it isn't recommended to try and align appVersion with chart version, but this way, a user knows they can use Helm chart version 0.3.x with any of cert-manager 0.3.x, and chart version 0.4.x with cert-manager 0.4.x. Compatibility is defined within the minor version. |
/remove-lifecycle stale |
I'd like to bring this back up for discussion. Overall we haven't seen much compelling in favor of versioning the charts for our internal apps when all that is changing is the image tag used by some components. When upgrading a release, the appVersion field seems like the right place for this information. Copying over my original proposal referenced above: Our current workflow for deploying helm charts involves ansible tasks that call the helm upgrade CLI command and it would be nice to be able to pass a flag to set the appVersion when revising a release for the same chart version. It may be a little weird conceptually because an appVersion is associated with a chart rather than release, but in our case we are just updating the image tag used for some containers and our workflow hasn't come to incorporate chart version and/or chart repositories yet. This may change in the future, but for now I don't see any issue with adding a flag for --app-version on install and upgrade as the field is purely informational. |
when developing our own internal applications the app itself changes a lot more than the chart that deploys it. Typically our Continuous Deployment command is a To make this more visible otherwise I have standardized on setting a metadata tag of |
Any news about this? Thanks |
When 'helm install/upgrade --app-version 1.0.0' is run, this will override the chart app version Closes helm#3555 Signed-off-by: Kevin Labesse <kevin@labesse.me>
When 'helm install/upgrade --app-version 1.0.0' is run, this will override the chart app version Closes helm#3555 Signed-off-by: Kevin Labesse <kevin@labesse.me> docs(helm): add --app-version flags for 'helm install/upgrade' Signed-off-by: Kevin Labesse <kevin@labesse.me>
Any update on this. It seems PR from @eraac does what is requested. As @TD-4242 mentioned, we also run |
Any updates? |
Aaaaany time soon would be lovely! |
it will be very useful |
Would also love the ability to set app version at install time as we use common charts to deploy applications |
+1 |
1 similar comment
+1 |
It would be very helpful |
Requesting the same |
Please stop the spam with the +1. There is already a PR (#4961) and people are discussing the proposal. The last reply was even 2 days ago. |
@filipre Could you please say: what happens with the PR? Looks like PR has no move half of month |
This would be very useful. I ran into something where I need to pin to version 0.6.0 of an app, and the chart version has no relation to the app version. |
I agree, I also think this would be very useful. Any updates? |
I read through a bunch (not all) of the discussion above, so sorry if I'm repeating some points / views. I'm trying to put forward a more considered response. I like seeing appVersion when I do a I'm firmly that (chart) If I do a A final point is that many public charts will not exactly match the docker container version they make use of. Take a look at most well known docker containers eg alpine or nginx where the major and minor versions are rolling tags with only patch versions not rolling. Having a 1:1 mapping for every patch version introduces quite a significant overhead for little to no benefit. The upshot of all of the above then begs the question "Why can helm use a chart repo at all?". |
@timothyclarke: What you might want to do, for the It's also a good chance to add build metadata to the Per #7517, that let me remove a bunch of This approach might actually resolve the problems most people have hit here, if they're building their own charts, and particularly if they're installing from the chart source in their checkout. It doesn't really help if they need this functionality for a chart coming from a repo, but I think that's a different issue than most people here are hitting? To me, the risk from overriding an app-version (or version) at install-time is that it's not as clearly visible to someone else trying to recreate the chart, that this was done. Unless it's somehow hacked into the values support, it won't be there when one extracts the current config of the chart using |
You hit the nail on the head. This should have bee in While I understand philosophical arguments against this feature, the field practice shows it would help people a lot -- including us. There are many charts in the wild which let you set the version of the app through |
I'm not sure if that has been discussed (did a quick CTRL+F and couldn't find any trace), but what about removing Right now I guess that could be provided in some different way. Maybe via release labels? Or maybe
Then, the support of that would be shifted to best practices, instead of being enforced by On the other hand, it might be, that many people rely on existing implementation of Maybe taking a step back and understanding why exactly |
@bokysan It was previously in @TBBle I'd address each of your points, but it would make this post as long as the previous one. I think this whole issue comes down to someone deciding that a generic chart is not a valid use case solely by looking at the charts in the public repo. The entire premise of appVersion falls flat on it's face as soon as you need to start using initContainers and sidecars. To give a real world example one of the projects I currently need to manage has nginx with a php sidecar. The nginx and php tag's don't change often. The php container / version is very important to the developers writing the code. The container that changes most frequently is the |
If it's important to your users, then it should be the PHP version, surely? That's what you're advertising. You could also stick all three in your appVersion, it's a freetext field after all. If you want to force If your chart source is part of the application, e.g. Agones, just leave None of these things need to be Honestly, the actual missing feature is probably "pass |
Then we're probably in #7517 That maybe where all this stems from. |
I do not understand this discussion at all. Why not giving people the option to use the app version in a way they think is the best fit for them is so much a big issue? In a current form for me will be best to not have this I also see that I just need to say to everyone to not use the I was optimistic at the start of reading this conversation but after going to the end seeing how you discuss this and how you fight to force users to have your way of thinking I lost hope now :(. |
Having two different outputs "CHART(version)" and "APP VERSION" in If "CHART(version)" and "APP VERSION" are tied at build-time ("helm package"), the whole benefit of having two different values is somewhat lost. Building a chart and updating the APP VERSION without incrementing/updating the CHART VERSION will result in big trouble as the same CHART VERSION will give you very different results. :-< So for now we are forced to build the package with every release and increment "CHART(version)" and "APP VERSION" in sync to not run into an insane/unclear situation. As I just learned, we could drop "APP VERSION", as it is optional und use some custom value and use that instead of {{ Chart.appVersion }} for our image.... but then From Users(Developers) Perspective:
Any chance we can get that done? |
I think this is the crux of the disalignment. The benefit of App Version as I use it, and as appears to be intended by the current setup, is that you know the version of a wrapped Application for that chart version, because the Chart Version is the version of the whole chart, not the version of the templates in the chart. I'd hate to have every statement like "We require Version ~X.Y of the Helm chart" to require "Oh, and don't mess with the AppVersion" added to the end. This benefit is lost of App Version (and the actual version of the app) is changed at install time, because now the Chart Version doesn't tell you what App you're using, and you lose the ability to use SemVer to ensure, e.g., you have the latest-but-API-compatible release. For the use-case @pniederlag is describing, being able to have |
Here where I got an issue with the We are using both the Release version and AppVersions. To set them now - I have to call the Now I'm adding the So - what now? Actually it's more an issue for the UPD Oh, wait... I'm still able to use |
We build two packages: a helm package with just the charts, sans the env values and secrets file. We rename this package to Then we have a second tgz that's environment specific, |
We are used to identify our applications versions, or most of them, with a semantic version number. Then use use this number in the APP VERSION to identify it easily in the
It's tricky, but it works as expected. |
@bvis |
Any further progress with programatically injecting Chart.yaml/appVersion ? Are there workarounds? It would give a tremendous boost in CI/CD Helm . |
@jakovistuk as far as I can tell, charts that use appVersion to show the container version do this directly via Chart.yaml, as seen in nginx-ingress/Chart.yaml for example... I haven't given much thought to this issue for quite some time, so this may be a really dumb question, but is there a way to use Helm CLI to override appVersion? |
It seems like a lot of people here are asking for a way to override the ‘appVersion’ field. The original intent/request in this issue is to allow —app-version as a replacement for —version, so a user could run ‘helm fetch —app-version=v0.15.0’ and Helm would work out what the latest chart version last specified v0.15.0 as an appVersion and fetch that. In our project/chart (cert-manager) we want to make it as clear to end users as possible which version they are installing, so allowing them to install by app version instead of chart version would be a far more natural installation experience. That said, this issue was opened 2y ago now, and since then we have opted to just keep both of these version numbers in sync/lock-step. After a couple of years doing this, it’s been surprisingly easy and pain free, albeit users sometimes have to wait a couple of weeks for a new official release if there are changes made to our deployment manifests. Given the age of this issue, it’s length, the huge variety of slightly different feature gates, and the changes in the Helm project since then (Helm 3, OCI charts etc), I don’t think this issue is in a good state to be driven forward as a feature request in its current form. I’m going to close this issue, but anyone else who has a similar feature request Is best to open a new issue and link to any other relevant comments in this issue to provide evidence. Hopefully that’ll work better for the Helm team’s triage process so your requests can get the visibility they need! I also think this sort of functionality could be, and probably is best, implemented as an external tool or wrapper around |
Until this is solved (or not) Here is how i solved this in my CI/CD (GitLab): package the chart with the app-version, then deploy it. deploy:
image: alpine/helm:3.2.4
stage: deploy
environment:
name: ${ENV}
script:
- helm package --app-version=${CI_COMMIT_TAG} --version=${CI_COMMIT_TAG} ${NAMESPACE}
- |
helm upgrade -i --wait ${CI_PROJECT_NAME} ./${NAMESPACE}-${CI_COMMIT_TAG}.tgz \
--set image.repository="${CI_REGISTRY_IMAGE}" \
--set image.tag="${CI_COMMIT_TAG}" \
--set-string ingress.enabled="${INGRESS}" \
--set service.port="${CONTAINER_PORT}" \
--set service.targetPort="${CONTAINER_PORT}" \
--set dc="${CI_ENVIRONMENT_NAME}" \
--set project="${CI_PROJECT_NAME}" \
--namespace ${NAMESPACE}
- helm history ${CI_PROJECT_NAME} -n ${NAMESPACE}
tags:
- kubernetes
only:
- tags |
If you default your There's no problem with Version being the same as AppVersion if your AppVersion happens to be SemVer. For packages produced by my team, we're moving towards things that look for AppVersion, e.g. image.tag, defaulting to Version if AppVersion is unset. It's not a huge difference, just one less argument to |
@TBBle that won't work if you are using a sub-chart to set your image tag |
Do you mean the image.tag is in a subchart, but you're trying to use the version of a parent chart? If so, yes, that's very awkward, and won't be easy to manage. I just bounced off exactly this layout in https://github.com/googleforgames/open-match/'s Helm charts. I suggest rolling the sub-charts in question back up into the main chart in this case. Charts should be independently isolated/usable units, not relying on parent-chart behaviours to function. The subchart has its own version, that's the one that its images should be using, otherwise, why is it a subchart? In Open Match's case, the subcharts appear to be used so that Or perhaps I've misunderstood the observation you're making. |
@haimari Unfortunately, its not working (relate to #6921 ?): > helm package $DIR/deployment/chart --app-version="1111e8" --version="3454e5" --namespace stage
Error: Invalid Semantic Version But, this works: > helm package $DIR/deployment/chart --app-version="0.0.0-1111e8" --version="0.0.0-3454e5" --namespace stage
Successfully packaged chart and saved it to: /Users/aws/service-0.0.0-3454e5.tgz and even this (but seems dirty): > helm package $DIR/deployment/chart --app-version="0-1111e8" --version="0-3454e5" --namespace stage
Successfully packaged chart and saved it to: /Users/aws/service-0-3454e5.tgz helm version version.BuildInfo{Version:"v3.4.0", GitCommit:"7090a89efc8a18f3d8178bf47d2462450349a004", GitTreeState:"dirty", GoVersion:"go1.15.3"} |
I think @haimari 's solution as-is only works because they use semver-compatible tags in their CI pipeline (i.e. this will be an example for a job run for tagged releases, not run on every-commit) @a0s: I generally suggest:
And then have your container image tag value be something like In your examples you have what appear to be two different git versions, is that right? Is one for the container image, and one for the chart? With SemVer, you can't really put a git commit SHA into the meaningful part of the semver, because semver implies ordering, and git commit SHAs are not sortable. So you'll want to use a version something like In SemVer, using a So with what you have used here, |
Yes, the app and the chart - there are two independent pieces of software.
What if i don't want (and even can't imagine) ask for the latest.
This string (after interpolation) seems too long to fit into one column of standard I always know what version (sha hash) of the app i want to install (pass it with What could go wrong?
What am i missed? PS To be honestly, i want to use short sha part in version and app-version for information purpose only (during |
If it's just for information purposes, then it goes after the This is what Open Match's Helm auto-built charts do, for example; they are all currently |
As far as I'm aware,
helm install
currently only supports specifying the--version
flag to specify a chart version to install.I'm unsure how the 'appVersion' field in a Chart.yaml is supposed to be used, but it seems generally useful to add support for versioning your application against a specific version (or version set) of a Chart.
Am I mis-using the
appVersion
field here? Should I instead be constantly building my chart to be backward compatible with previous version, or otherwise how can I infer to my users which chart version to specify when runninghelm install
if they want a particular version (this becomes even more complex when you consider a user can also change the version deployed with something like--set image.tag
, which often results in a version change of an application).The text was updated successfully, but these errors were encountered: