From 1717aff3bb250aca0cacbf1cac2bed248c71cde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Cabrera=20Mi=C3=B1agorri?= Date: Fri, 13 May 2022 17:05:33 +0200 Subject: [PATCH] [bitnami/magento] Use the new helper for HPA API version (#10203) * Use the new helper for HPA API version Signed-off-by: Miguel A. Cabrera Minagorri * Contemplate targetAverageUtilization Signed-off-by: Miguel A. Cabrera Minagorri --- bitnami/magento/Chart.lock | 10 +++++----- bitnami/magento/Chart.yaml | 2 +- bitnami/magento/templates/hpa.yaml | 14 +++++++++++++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/bitnami/magento/Chart.lock b/bitnami/magento/Chart.lock index ca0c2c49b..9362d070b 100644 --- a/bitnami/magento/Chart.lock +++ b/bitnami/magento/Chart.lock @@ -1,12 +1,12 @@ dependencies: - name: mariadb repository: https://charts.bitnami.com/bitnami - version: 11.0.2 + version: 11.0.3 - name: elasticsearch repository: https://charts.bitnami.com/bitnami - version: 18.0.1 + version: 18.0.3 - name: common repository: https://charts.bitnami.com/bitnami - version: 1.13.1 -digest: sha256:8130a33fa421cc2f1b177ed14ff24ff573ff3640fdabd115d31c78f651ee242b -generated: "2022-05-05T10:58:35.358915+02:00" + version: 1.14.0 +digest: sha256:6c57e7684a5e97692c6aa4ed9d121c58a2571a8fb305501e81a19a7ef571c9a0 +generated: "2022-05-13T15:11:53.945826+02:00" diff --git a/bitnami/magento/Chart.yaml b/bitnami/magento/Chart.yaml index 97a5878ad..3601b5437 100644 --- a/bitnami/magento/Chart.yaml +++ b/bitnami/magento/Chart.yaml @@ -35,4 +35,4 @@ name: magento sources: - https://github.com/bitnami/bitnami-docker-magento - https://magento.com/ -version: 20.0.2 +version: 20.0.3 diff --git a/bitnami/magento/templates/hpa.yaml b/bitnami/magento/templates/hpa.yaml index d9c21dfb0..e1f3dfdf5 100644 --- a/bitnami/magento/templates/hpa.yaml +++ b/bitnami/magento/templates/hpa.yaml @@ -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 + {{- if semverCompare "<1.23-0" (include "common.capabilities.kubeVersion" .) }} targetAverageUtilization: {{ .Values.autoscaling.targetMemory }} + {{- else }} + target: + type: Utilization + averageUtilization: {{ .Values.autoscaling.targetMemory }} + {{- end }} {{- end }} {{- end }}