[bitnami/minio] Use the new helper for HPA API version (#10205)

* 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>

* Bump common and update HPA

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

* Rebase master

Signed-off-by: Miguel A. Cabrera Minagorri <devgorri@gmail.com>
This commit is contained in:
Miguel Ángel Cabrera Miñagorri
2022-05-24 16:51:55 +02:00
committed by GitHub
parent a308a5477f
commit db5fb6157c
2 changed files with 15 additions and 3 deletions

View File

@@ -25,4 +25,4 @@ name: minio
sources:
- https://github.com/bitnami/bitnami-docker-minio
- https://min.io
version: 11.5.4
version: 11.5.5

View File

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