Closed kfirfer closed 2 years ago
Put something like this in your helmfiles:
apiVersions:
{{- if (env "KUBE_API_VERSIONS") }}
{{- range $apiV := ( requiredEnv "KUBE_API_VERSIONS" | split "," ) }}
- {{ $apiV }}
{{- end }}
{{- end }}
I personally put that snippet in as base
file and have something like this at the top of all my release yaml:
---
bases:
- ../../bases/repositories.yaml
- ../../bases/environments.yaml.gotmpl
- ../../bases/api-versions.yaml
# https://github.com/roboll/helmfile/issues/1230
---
releases:
...
Thanks ill try it
I also trying to put this env var of repo server:
- name: HELM_TEMPLATE_OPTIONS
value: "--kube-version 1.22 --validate"
Will update if its works
The HELM_TEMPLATE_OPTIONS envar doesnt worked although I tried to run helm templat and its outputting the prometheusrule:
helm template ingress-nginx ingress-nginx/ingress-nginx --version 4.2.1 --namespace ingress-nginx --values nucs/dev/us-east/infra/namespaces/ingress-nginx/helmfile/ingress-nginx/values.yaml --values nucs/dev/us-east/infra/namespaces/ingress-nginx/helmfile/ingress-nginx/values-env-specific.yaml --kube-version 1.22 --validate > output.yaml
You shouldn't need to handle those values manually, argocd passes both the kube version and api versions off to the plugin as standard procedure (which is good because if you have argocd handling multiple clusters the values should be dynamic anyway).
I think what makes the difference is the --validate argument to the helm template, not the kubeapi version
I mean both makes the differences I guess
Is it working with the snippet I sent then?
yes it is, thanks !
Hello
Theres some charts for example
ingress-nginx
that cannot read the go template.Capabilities.APIVersions.Has
For example im trying to install ingress-nginx chart with prometheus rule enabled and he doesnt get know if it capability
Example go template:
What should I do ?