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

Helm with Kustomize uses wrong kubernetes version when templating #478

Open
ChampiYann opened this issue Mar 29, 2023 · 1 comment
Open

Comments

@ChampiYann
Copy link

Describe the bug
I cannot add an application that uses a Helm chart with Kustomize if the Helm has a minimum kubeVersion requirement higher than v1.20.0 even though the cluster is running kubernetes version 1.23.x
This is the same issue as described here: https://stackoverflow.com/questions/75008850/kustomize-helm-error-on-chart-semver-requirements

To Reproduce
Steps to reproduce the behavior:

  1. Install the Openshift GitOps operator on a 4.10.36 Openshift cluster
  2. Edit the argocd/openshift-gitops resource in namespace openshift-gitops and add kustomizeBuildOptions: '--enable-helm' to the specs
  3. Create a repo with a kustomize file referencing a helm chart with a minimum kubeVersion requirement higher than v1.20.0. For example:
    apiVersion: kustomize.config.k8s.io/v1beta1
    kind: Kustomization
    metadata:
      name: jira-data-center
    
    helmCharts:
    - name: jira
      version: 1.8.1
      repo: https://atlassian.github.io/data-center-helm-charts
      valuesFile: values.yaml
      releaseName: jira-data-center
  4. Add a values.yaml file to the repo (this can be the default values.yaml file)
  5. Add an application to ArgoCD referencing the repo
  6. See error

Expected behavior
The application is created

Screenshots
Error message:

Unable to create application: application spec for jira-test is invalid: InvalidSpecError: Unable to generate manifests in kustomize/envs/prd: rpc error: code = Unknown desc = Manifest generation error (cached): `kustomize build .kustomize/envs/prd --enable-helm` failed exit status 1: Error: accumulating resources: accumulation err='accumulating resources from '../../base': '.kustomize/base' must resolve to a file': recursed accumulation of path '.kustomize/base': Error: chart requires kubeVersion: >=1.21.x-0 which is incompatible with Kubernetes v1.20.0 Use --debug flag to render out invalid YAML : unable to run: 'helm template jira-data-center .kustomize/base/charts/jira --values /tmp/kustomize-helm-1206483794/jira-kustomize-values.yaml' with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-1206483794/helm HELM_CACHE_HOME=/tmp/kustomize-helm-1206483794/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-1206483794/helm/.data] (is 'helm' installed?)

The folder structure the slightly different here than in the reproduction steps, but the kustomize file in env/prd has base as only resource, so the situation is similar.

Additional context
According to the stackoverflow entry mentioned above, it looks like Helm falls back to a default kube version, maybe because it has no reference to the cluster.

@ChampiYann
Copy link
Author

The same deployment works with the ArgoCD community operator by the way.

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