helm-diff icon indicating copy to clipboard operation
helm-diff copied to clipboard

Add support for setting Capabilities.KubeVersion.Version

Open pgier opened this issue 3 years ago • 2 comments

This is maybe a duplicate of #318, but I think it would be a worthwhile feature. The use case I have is that I'm using the kube-prometheus-stack helm chart which is still relying on Capabilities.KubeVersion.Version in the latest release.

https://github.com/prometheus-community/helm-charts/blob/kube-prometheus-stack-32.2.0/charts/kube-prometheus-stack/templates/_helpers.tpl#L134

{{- define "kube-prometheus-stack.kubeVersion" -}}
  {{- default .Capabilities.KubeVersion.Version .Values.kubeVersionOverride -}}
{{- end -}}

Currently, I can't get an accurate diff in my project because the kube-prometheus-stack chart calculates the wrong api version for Ingress because of the missing KubeVersion.

I'm not sure if it would be better to add a --kube-version arg similar what helm template uses, or if the version could be retrieved from the remote server and then set in helm template, that would also work.

pgier avatar Feb 12 '22 22:02 pgier

As usual, I noticed a workaround right after creating the issue. In case it helps anyone else, the way to get around this issue with the kube-prometheus-stack, is to set kubeVersionOverride.

kube-prometheus-stack:
  kubeVersionOverride: 1.21

I think an option to pass the kube version to the helm template generation would still be useful so that this workaround would not be necessary.

pgier avatar Feb 12 '22 23:02 pgier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jun 12 '22 14:06 stale[bot]