Skip to content

Commit

Permalink
Update keda.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thomas-22 committed Jul 24, 2024
1 parent 4c82286 commit e7022ea
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions charts/nitro/templates/validator/keda.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@
{{- $deployment := . }}
{{- $mergedValues := merge $global $deployment }}
{{- if $mergedValues.keda.enabled }}
{{- with $mergedValues.keda.scaledObject }}
{{- $scaledObject := deepCopy $mergedValues.keda.scaledObject }}
{{- range $index, $trigger := $scaledObject.triggers }}
{{- if eq $trigger.type "prometheus" }}
{{- $trigger := set $trigger "metadata" (deepCopy $trigger.metadata) }}
{{- if $trigger.metadata.queryTemplate }}
{{- $_ := set $trigger.metadata "query" (tpl $trigger.metadata.queryTemplate $) }}
{{- $_ := unset $trigger.metadata "queryTemplate" }}
{{- end }}
{{- end }}
{{- end }}
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
Expand All @@ -15,8 +24,7 @@ metadata:
spec:
scaleTargetRef:
deploymentName: {{ include "nitro.fullname" $ }}-val-{{ $deployment.name }}
{{- . | toYaml | nindent 2 }}
{{- end }}
{{- $scaledObject | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit e7022ea

Please sign in to comment.