[bitnami/osclass] Use the new helper for HPA API version (#10210)

* Use the new helper for HPA API version

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>

* Contemplate targetAverageUtilization

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2022-05-14 12:08:36 +02:00
committed by GitHub
parent c69adae4cb
commit 287854f5d6
3 changed files with 19 additions and 7 deletions

View File

@@ -1,9 +1,9 @@
dependencies:
- name: mariadb
repository: https://charts.bitnami.com/bitnami
version: 11.0.0
version: 11.0.3
- name: common
repository: https://charts.bitnami.com/bitnami
version: 1.13.0
digest: sha256:9d2fbcd033ad308afbd7a3383541a2a006e5d30b282ecd16c6b3d1cbe6dc5b08
generated: "2022-04-21T11:25:53.604642+02:00"
version: 1.14.0
digest: sha256:cf0c93f6a162ae8893feceafc16a3155ed14d05f18479056b75a595f06cc1fe8
generated: "2022-05-13T15:14:49.487961+02:00"

View File

@@ -31,4 +31,4 @@ name: osclass
sources:
- https://github.com/bitnami/bitnami-docker-osclass
- https://osclass.org/
version: 14.0.2
version: 14.0.3

View File

@@ -1,5 +1,5 @@
{{- if .Values.autoscaling.enabled }}
apiVersion: autoscaling/v2beta1
apiVersion: {{ include "common.capabilities.hpa.apiVersion" . }}
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "common.names.fullname" . }}
@@ -23,12 +23,24 @@ spec:
- type: Resource
resource:
name: cpu
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetCPU }}
{{- end }}
{{- end }}
{{- if .Values.autoscaling.targetMemory }}
- type: Resource
resource:
name: memory
targetAverageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }}
targetAverageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- else }}
target:
type: Utilization
averageUtilization: {{ .Values.autoscaling.targetMemory }}
{{- end }}
{{- end }}
{{- end }}