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

fix HPA api version #117

Merged
merged 11 commits into from
Jun 12, 2024
Merged
2 changes: 1 addition & 1 deletion charts/metabase/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description:
The easy, open source way for everyone in your company to ask questions
and learn from data.
name: metabase
version: 2.15.7
version: 2.15.8
appVersion: v0.49.13
maintainers:
- name: pmint93
Expand Down
11 changes: 11 additions & 0 deletions charts/metabase/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,17 @@ Return the apiVersion of deployment.
{{- end -}}
{{- end -}}

{{/*
Return the apiVersion of hpa.
*/}}
{{- define "hpa.apiVersion" -}}
{{- if semverCompare "<1.23-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "autoscaling/v1" -}}
{{- else if semverCompare ">=1.23-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "autoscaling/v2" -}}
{{- end -}}
{{- end -}}

{{/*
Create the name of the service account to use
*/}}
Expand Down
2 changes: 1 addition & 1 deletion charts/metabase/templates/hpa.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{- if .Values.hpa.enabled }}
apiVersion: autoscaling/v2beta2
apiVersion: {{ template "hpa.apiVersion" . }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "metabase.fullname" . }}
Expand Down
Loading