kustomize icon indicating copy to clipboard operation
kustomize copied to clipboard

Is it possible to have kustomize ensure we have the latest version of a Helm chart?

Open Jont828 opened this issue 3 years ago • 10 comments

Kustomize is being used in Cluster API to fetch Helm charts with the --enable-helm flag. I'm working on an issue where I'd like to have kustomize pull the chart when a new version is found on the repo. Currently, if the chart has been pulled and a new version is released, the only way to update it is to delete the chart so kustomize will run a fresh pull. Is it possible to have kustomize find the latest version without manually deleting and repulling every time?

Jont828 avatar Aug 23 '22 00:08 Jont828

/kind bug /triage accepted

Currently, kustomize implements the helm plugin by pulling down remote charts to the local kustomization directory. That means between builds, it uses this locally cached version instead of pulling from the remote chart each time. Unfortunately that means when you update the version, kustomize does not re-pull the chart and you are stuck with the old version unless you manually delete it.

In the bug scrub, we discussed that the right fix for this would be to instead download the remote chart to a temporary directory where we use it only for the current build, and clean it up after. That means each kustomize build will freshly download the chart instead of using cached versions from the previous build. This may have some performance impacts.

natasha41575 avatar Sep 28 '22 16:09 natasha41575

This may have some performance impacts.

Yup unfortunately in our case this will mean that we will be downloading the charts a lot (we are using kustomize in combination with Tilt).

Would it be possible to have some config or flag which allows us to continue to use the current behavior after this change is implemented?

sbueringer avatar Sep 28 '22 17:09 sbueringer

It seems that Kustomize will ignore chart version value change. It would make sense to detect that downloaded chart version differs from the desired version.

yohancourbe avatar Feb 03 '23 16:02 yohancourbe

I am also running into this. It would be very helpful if the version update is taken into account and a new helm chart downloaded

schlichtanders avatar Feb 27 '23 17:02 schlichtanders

Hi, I have also faced this issue with argocd. From my perspective it's a flaw, that makes me question kustomize maturity.

m00lecule avatar Mar 14 '23 10:03 m00lecule

Would it be possible to have some config or flag which allows us to continue to use the current behavior after this change is implemented?

Wdyt about having something like a chartPullPolicy (analogous to imagePullPolicy), with similar options to determine whether we should repull the chart or not?

natasha41575 avatar Aug 18 '23 17:08 natasha41575

I've been searching far and wide for the cleanest solution to using helm charts, while having the flexibility to do things like append to lists/arrays or change the chart version per environment. Kustomize with helmCharts is the closest I've seen to an intuitive, simple process for doing so.

With that being said, the first thing I attempted to do was to bump the version of a chart. Unfortunately, nothing changed. This is a strange design decision, as I would imagine at least some functionality out of the box for updating versions. Why not have something simple -- if the version in the kustomization.yaml is different than the one in the charts directory, update it?

anthonyalayo avatar Feb 18 '24 22:02 anthonyalayo