fix: only emit keda fallback when a non-cpu/memory trigger exists

Keda 2.17+ rejects ScaledObjects whose spec.fallback is set unless at least one trigger is not a cpu or memory scaler, so unconditionally emitting fallback broke deploys for apps autoscaled on cpu or memory alone. The chart now skips the fallback block when every configured trigger is cpu or memory and keeps the existing behavior otherwise.
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-29 01:10:34 -04:00
parent 8a6c853ccd
commit f728fc8cd7
3 changed files with 127 additions and 0 deletions

View File

@@ -33,9 +33,17 @@ spec:
pollingInterval: {{ $config.autoscaling.polling_interval_seconds }}
minReplicaCount: {{ $config.autoscaling.min_replicas }}
maxReplicaCount: {{ $config.autoscaling.max_replicas }}
{{- $hasFallbackTrigger := false }}
{{- range $config.autoscaling.triggers }}
{{- if and (ne .type "cpu") (ne .type "memory") }}
{{- $hasFallbackTrigger = true }}
{{- end }}
{{- end }}
{{- if $hasFallbackTrigger }}
fallback:
failureThreshold: 3
replicas: {{ $config.replicas }}
{{- end }}
{{- if $config.autoscaling.triggers }}
triggers:
{{- with $config.autoscaling.triggers }}