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

helmCharts does not support 1+ instances of same chart, with different versions #4813

Open
ghost opened this issue Sep 30, 2022 · 7 comments · Fixed by #4999
Open

helmCharts does not support 1+ instances of same chart, with different versions #4813

ghost opened this issue Sep 30, 2022 · 7 comments · Fixed by #4999
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@ghost
Copy link

ghost commented Sep 30, 2022

Describe the bug

When I define multiple chart instances in helmCharts for same chart but with different versions, the first version defined is pulled and used for all instances.

Files that can reproduce the issue

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

namespace: podinfo

helmCharts:
  - name: podinfo
    repo: https://stefanprodan.github.io/podinfo
    version: 6.2.1
    releaseName: podinfo1
  - name: podinfo
    repo: https://stefanprodan.github.io/podinfo
    version: 6.1.8                                      # <------ same chart, different version
    releaseName: podinfo2

Expected output

For the supplied kustomization.yaml we should see two Deployment resources with different images, but we do not.

Actual output

For the supplied kustomization.yaml we see two Deployment resources with matching images.

To verify:

$ kustomize build --enable-helm | grep -E 'image:.*podinfo'
        image: ghcr.io/stefanprodan/podinfo:6.2.1
        image: ghcr.io/stefanprodan/podinfo:6.2.1

Versions

Kustomize version: 4.5.7

Helm version: 3.9.4

Platform

I don't believe it's relevant, but I am on Mac.

Additional context

Since kustomize has a --helm-command I wrote a wrapper to inspect the helm executions made by kustomize.

Here are the executions:

helm version -c --short
helm pull --untar --untardir ./charts --repo https://stefanprodan.github.io/podinfo podinfo --version 6.2.1
helm template podinfo1 ./charts/podinfo --values .../kustomize-helm-3061748730/podinfo-kustomize-values.yaml
helm version -c --short
helm template podinfo2 ./charts/podinfo --values .../kustomize-helm-3953294510/podinfo-kustomize-values.yaml

Observerations:

  • only 1 helm pull of the 1st version, untarred to unversioned path
  • two helm template execs on the unversioned chart location

I conclude this is not a Helm issue, but a Kustomize issue.

Suggested fix: add the version to the chart directory (eg podinfo-6.2.1) and use the versioned dir in the helm template execs.

Regards.

@ghost ghost added the kind/bug Categorizes issue or PR as related to a bug. label Sep 30, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Sep 30, 2022
@ghost ghost changed the title helmCharts does not support 1+ instances of same chart, but different version helmCharts does not support 1+ instances of same chart, with different versions Sep 30, 2022
@natasha41575
Copy link
Contributor

/triage accepted

Kustomize caches the helm chart under a directory that just matches the chart name. It should also be storing the version in the cache directory name so that it can check if the version matches when it is updated, and also support this use case of having different chart versions.

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 9, 2022
dlish pushed a commit to dlish/kustomize that referenced this issue Mar 22, 2023
dlish pushed a commit to dlish/kustomize that referenced this issue Mar 31, 2023
k8s-ci-robot pushed a commit that referenced this issue Apr 24, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue #4813

* Use if/else for readability, add version check to absChartHome
@natasha41575
Copy link
Contributor

Rather unfortunately we had to revert #4999 so I am reopening this. My bad for not catching the regression!

@natasha41575 natasha41575 reopened this May 9, 2023
@redspart
Copy link

Rather unfortunately we had to revert #4999 so I am reopening this. My bad for not catching the regression!

Hi @natasha41575, do we have any updates on this?

@natasha41575
Copy link
Contributor

natasha41575 commented Aug 18, 2023

Details of why we had to revert the change are in #4999 (comment). We need to make sure that we don't modify the directory format of where the chart lives, as it breaks the workflow of users with local charts.

If someone wants to pick this up, please take care to look at the previous PR and why we had to revert it.

ardikabs pushed a commit to ardikabs/kustomize that referenced this issue Aug 24, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
@ardikabs
Copy link
Contributor

ardikabs commented Aug 24, 2023

hi @natasha41575, I have just submitted a PR to fix #4999 as well this issue, Could you take a look at it?
Thank you!

ardikabs pushed a commit to ardikabs/kustomize that referenced this issue Aug 26, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
ardikabs pushed a commit to ardikabs/kustomize that referenced this issue Oct 4, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
ardikabs pushed a commit to ardikabs/kustomize that referenced this issue Oct 5, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
ardikabs pushed a commit to ardikabs/kustomize that referenced this issue Nov 1, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
@ardikabs
Copy link
Contributor

@natasha41575 , i think we can close this as per #5293

antoooks pushed a commit to antoooks/kustomize that referenced this issue Nov 21, 2023
* Fix using same helm chart with different versions

* Fix p.ValuesFile when version is set

* Updated: Fix using same helm chart with different versions

* Add test for issue kubernetes-sigs#4813

* Use if/else for readability, add version check to absChartHome
@k8s-triage-robot
Copy link

This issue has not been updated in over 1 year, and should be re-triaged.

You can:

  • Confirm that this issue is still relevant with /triage accepted (org members only)
  • Close this issue with /close

For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/

/remove-triage accepted

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. and removed triage/accepted Indicates an issue or PR is ready to be actively worked on. labels Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

Successfully merging a pull request may close this issue.

5 participants