Describe the bug
The Loki helm chart fails to deploy on older Kubernetes clusters due to Pod Disruption budget being moved to stable policy/v1beta1 to policy/v1. We are using an old verison of Kubernetes that is still on the policy/v1beta1 endpoint. It appears a template exists in _helpers.tpl that correctly determines which apiVersion to use. However, this template does not appear to be applied in every file. This results in an error message when installing the chart.
_helpers.tpl template
{{- define "loki.pdb.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">=1.21-0" .Capabilities.KubeVersion.Version) -}}
{{- print "policy/v1" -}}
{{- else -}}
{{- print "policy/v1beta1" -}}
{{- end -}}
{{- end -}}
Describe the bug The Loki helm chart fails to deploy on older Kubernetes clusters due to Pod Disruption budget being moved to stable policy/v1beta1 to policy/v1. We are using an old verison of Kubernetes that is still on the policy/v1beta1 endpoint. It appears a template exists in _helpers.tpl that correctly determines which apiVersion to use. However, this template does not appear to be applied in every file. This results in an error message when installing the chart.
_helpers.tpl template
Affected files: https://github.com/grafana/loki/blob/main/production/helm/loki/templates/read/poddisruptionbudget-read.yaml#L4 https://github.com/grafana/loki/blob/main/production/helm/loki/templates/backend/poddisruptionbudget-backend.yaml https://github.com/grafana/loki/blob/main/production/helm/loki/templates/gateway/poddisruptionbudget-gateway.yaml https://github.com/grafana/loki/blob/main/production/helm/loki/templates/single-binary/pdb.yaml https://github.com/grafana/loki/blob/main/production/helm/loki/templates/write/poddisruptionbudget-write.yaml
To Reproduce Steps to reproduce the behavior:
Expected behavior The helm install to succeed without error.
Suggested Solution Use the helpers.tpl template to correctly identify the API version for PodDisruptionBudget.
Environment:
Screenshots, Promtail config, or terminal output