You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Is template function .Capabilities.APIVersions.has reliable using helm template? #10760
Cloud Provider/Platform (AKS, GKE, Minikube etc.): on premise (kubespray)
Deploy workflow: using argoCD (helm template)
Helm template snippet:
{{- if .Capabilities.APIVersions.Has "policy/v1" -}}
apiVersion: policy/v1
{{- else}}
apiVersion: policy/v1beta1
{{- end }}
Trouble
helm template --kube-version 1.19.0 --api-versions policy/v1beta1 . should display apiVersion: policy/v1beta1 but .Capabilities.APIVersions.Has "policy/v1" returns true. In my understanding, --kube-version 1.19.0 should make Helm , k8s 1.19.0 compatible.
helm install is OK, but argoCD is doing a helm template.
helm template does not reach out to a Kubernetes cluster. It uses whatever APIVersions the Kubernetes client provides unless you pass the --validate flag.
Reacted by John McCrummen, Renzo Tomà @ DPG, Shinebayar G, Shay and Tao Liu
Hi, is there any documentation on how to make helm template --kube-version='1.22' --api-versions='networking.k8s.io/v1/Ingress ...' actually use those api-versions without needing any cluster context?
Activity
bacongobbler commentedon Mar 11, 2022
helm templatedoes not reach out to a Kubernetes cluster. It uses whatever APIVersions the Kubernetes client provides unless you pass the--validateflag.ebuildy commentedon Mar 11, 2022
By
Kubernetes client, you mean the one compiled?bacongobbler commentedon Mar 11, 2022
Yes.
ebuildy commentedon Mar 11, 2022
ok I see, to sum up: helm template function
.Capabilities.APIVersions.hasis not reliable when using argoCD .Related to argoproj/argo-cd#3640
Thanks you, I am continuing on this side.
Morriz commentedon Apr 2, 2022
Hi, is there any documentation on how to make
helm template --kube-version='1.22' --api-versions='networking.k8s.io/v1/Ingress ...'actually use those api-versions without needing any cluster context?fix(k8s): helm diff in kube-prometheus-stack-operator ClusterRole
fix(k8s): helm diff in kube-prometheus-stack-operator ClusterRole (#1443