From 085fb88a8c88ffb7fb9b534e88c034140d037116 Mon Sep 17 00:00:00 2001 From: joss Date: Wed, 15 Nov 2023 16:08:01 +0000 Subject: [PATCH] fix(chart): Pass metrics and behaviour as whole dicts --- charts/trino/templates/autoscaler.yaml | 20 ++++++++------------ charts/trino/values.yaml | 8 ++++++-- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/charts/trino/templates/autoscaler.yaml b/charts/trino/templates/autoscaler.yaml index 03b1695..be2443a 100644 --- a/charts/trino/templates/autoscaler.yaml +++ b/charts/trino/templates/autoscaler.yaml @@ -10,17 +10,13 @@ spec: apiVersion: apps/v1 kind: Deployment name: {{ template "trino.worker" . }} + {{- if .Values.server.autoscaling.metrics }} metrics: - {{- if .Values.server.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.server.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.server.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.server.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} + {{- tpl (toYaml .Values.server.autoscaling.metrics) . | nindent 4 }} + {{- end }} + {{- if .Values.server.autoscaling.behavior }} + behavior: + {{- tpl (toYaml .Values.server.autoscaling.behavior) . | nindent 4 }} + {{- end }} + {{- end }} diff --git a/charts/trino/values.yaml b/charts/trino/values.yaml index 11dfc99..ac1a966 100644 --- a/charts/trino/values.yaml +++ b/charts/trino/values.yaml @@ -56,8 +56,12 @@ server: autoscaling: enabled: false maxReplicas: 5 - targetCPUUtilizationPercentage: 50 - targetMemoryUtilizationPercentage: + metrics: + - type: Resource + resource: + name: cpu + targetAverageUtilization: 50 + behavior: # use this to override the standard entrypoint when you need to use the vault agent injector entrypointOverride: {}