Skip to content

Commit

Permalink
fix(chart): Pass metrics and behaviour as whole dicts
Browse files Browse the repository at this point in the history
  • Loading branch information
JossWhittle committed Nov 15, 2023
1 parent 5b2bcc2 commit 085fb88
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
20 changes: 8 additions & 12 deletions charts/trino/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
8 changes: 6 additions & 2 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: {}
Expand Down

0 comments on commit 085fb88

Please sign in to comment.