From 7f7f7183fb53f45a15cf560b726aadfe4896f06b Mon Sep 17 00:00:00 2001 From: felix Date: Wed, 6 Sep 2023 11:52:35 +0000 Subject: [PATCH 1/2] updated to autoscaling/v2 --- charts/matrix-media-repo/templates/hpa.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/charts/matrix-media-repo/templates/hpa.yaml b/charts/matrix-media-repo/templates/hpa.yaml index f07019f..46c0d16 100644 --- a/charts/matrix-media-repo/templates/hpa.yaml +++ b/charts/matrix-media-repo/templates/hpa.yaml @@ -1,9 +1,5 @@ {{- if .Values.autoscaling.enabled }} -{{- if .Capabilities.APIVersions.Has "autoscaling/v2" -}} -apiVersion: autoscaling/v2 -{{- else -}} -apiVersion: autoscaling/v2beta1 -{{- end }} +apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} kind: HorizontalPodAutoscaler metadata: name: {{ include "matrix-media-repo.fullname" . }} @@ -21,12 +17,16 @@ spec: - type: Resource resource: name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} + target: + type: Utilization + AverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} + target: + type: Utilization + AverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }} From 3c4b1cf344b77a0e71bf27de6bd23f74017658ba Mon Sep 17 00:00:00 2001 From: felix Date: Thu, 7 Sep 2023 10:39:10 +0000 Subject: [PATCH 2/2] set apiVersion to v2 --- charts/matrix-media-repo/templates/hpa.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/matrix-media-repo/templates/hpa.yaml b/charts/matrix-media-repo/templates/hpa.yaml index 46c0d16..af7dd15 100644 --- a/charts/matrix-media-repo/templates/hpa.yaml +++ b/charts/matrix-media-repo/templates/hpa.yaml @@ -1,5 +1,5 @@ {{- if .Values.autoscaling.enabled }} -apiVersion: {{ ternary "autoscaling/v2" "autoscaling/v2beta2" (.Capabilities.APIVersions.Has "autoscaling/v2") }} +apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: {{ include "matrix-media-repo.fullname" . }}