2024-03-12 13:43:51 +00:00
|
|
|
{{- if and (eq .Values.controller.kind "Deployment") .Values.controller.keda.enabled (not .Values.controller.autoscaling.enabled) -}}
|
2020-11-18 20:22:34 +00:00
|
|
|
apiVersion: {{ .Values.controller.keda.apiVersion }}
|
|
|
|
kind: ScaledObject
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
{{- include "ingress-nginx.labels" . | nindent 4 }}
|
|
|
|
app.kubernetes.io/component: controller
|
2021-11-19 14:52:52 +00:00
|
|
|
{{- with .Values.controller.labels }}
|
|
|
|
{{- toYaml . | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-11-18 20:22:34 +00:00
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
2023-11-01 21:59:56 +00:00
|
|
|
namespace: {{ include "ingress-nginx.namespace" . }}
|
2021-01-20 15:37:46 +00:00
|
|
|
{{- if .Values.controller.keda.scaledObject.annotations }}
|
|
|
|
annotations: {{ toYaml .Values.controller.keda.scaledObject.annotations | nindent 4 }}
|
|
|
|
{{- end }}
|
2020-11-18 20:22:34 +00:00
|
|
|
spec:
|
|
|
|
scaleTargetRef:
|
2021-01-14 10:29:32 +00:00
|
|
|
{{- if eq .Values.controller.keda.apiVersion "keda.k8s.io/v1alpha1" }}
|
2020-11-18 20:22:34 +00:00
|
|
|
deploymentName: {{ include "ingress-nginx.controller.fullname" . }}
|
2021-01-14 10:29:32 +00:00
|
|
|
{{- else if eq .Values.controller.keda.apiVersion "keda.sh/v1alpha1" }}
|
|
|
|
name: {{ include "ingress-nginx.controller.fullname" . }}
|
|
|
|
{{- end }}
|
2020-11-18 20:22:34 +00:00
|
|
|
pollingInterval: {{ .Values.controller.keda.pollingInterval }}
|
|
|
|
cooldownPeriod: {{ .Values.controller.keda.cooldownPeriod }}
|
|
|
|
minReplicaCount: {{ .Values.controller.keda.minReplicas }}
|
|
|
|
maxReplicaCount: {{ .Values.controller.keda.maxReplicas }}
|
2023-06-11 18:51:46 +00:00
|
|
|
{{- with .Values.controller.keda.fallback }}
|
|
|
|
fallback:
|
|
|
|
failureThreshold: {{ .failureThreshold | default 3 }}
|
|
|
|
replicas: {{ .replicas | default $.Values.controller.keda.maxReplicas }}
|
|
|
|
{{- end }}
|
2020-11-18 20:22:34 +00:00
|
|
|
triggers:
|
|
|
|
{{- with .Values.controller.keda.triggers }}
|
|
|
|
{{ toYaml . | indent 2 }}
|
|
|
|
{{ end }}
|
|
|
|
advanced:
|
|
|
|
restoreToOriginalReplicaCount: {{ .Values.controller.keda.restoreToOriginalReplicaCount }}
|
|
|
|
{{- if .Values.controller.keda.behavior }}
|
|
|
|
horizontalPodAutoscalerConfig:
|
|
|
|
behavior:
|
|
|
|
{{ with .Values.controller.keda.behavior -}}
|
|
|
|
{{ toYaml . | indent 8 }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|