From 6527ea31229ca7389a5f0a4e9d85ec9604a753b2 Mon Sep 17 00:00:00 2001 From: Thomas Carmet <8408330+tcarmet@users.noreply.github.com> Date: Thu, 25 Jan 2024 11:13:46 -0800 Subject: [PATCH] Review hpa template to make diff work with gitops (#109) --- charts/artifacts/templates/autoscaler.yaml | 14 +++++++++++++- charts/artifacts/values.yaml | 15 ++------------- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/charts/artifacts/templates/autoscaler.yaml b/charts/artifacts/templates/autoscaler.yaml index ab910f0..1a4c206 100644 --- a/charts/artifacts/templates/autoscaler.yaml +++ b/charts/artifacts/templates/autoscaler.yaml @@ -13,4 +13,16 @@ spec: name: {{ template "fullname" $ }} minReplicas: {{ .Values.deployment.minReplicas }} maxReplicas: {{ .Values.deployment.maxReplicas }} -{{ toYaml .Values.deployment.autoscalerSpec | indent 2 }} + metrics: + - type: Resource + resource: + name: memory + target: + type: AverageValue + averageValue: {{ .Values.deployment.autoscalerSpec.memoryUtilization }} + - type: Resource + resource: + name: cpu + target: + type: Utilization + averageUtilization: {{ .Values.deployment.autoscalerSpec.cpuUtilization }} diff --git a/charts/artifacts/values.yaml b/charts/artifacts/values.yaml index 23830d1..da378e2 100644 --- a/charts/artifacts/values.yaml +++ b/charts/artifacts/values.yaml @@ -86,19 +86,8 @@ deployment: ## of criterias to meet to scale up and down. ## autoscalerSpec: - metrics: - - type: Resource - resource: - name: cpu - target: - type: Utilization - averageUtilization: 50 - - type: Resource - resource: - name: memory - target: - type: AverageValue - averageValue: 500Mi + cpuUtilization: 50 + memoryUtilization: 500Mi artifacts: ## Configure resource requests and limits