| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 1 | {{- if and .Values.controller.keda.enabled (or (eq .Values.controller.kind "Deployment") (eq .Values.controller.kind "Both")) -}} |
| 2 | # https://keda.sh/docs/ |
| 3 | |
| 4 | apiVersion: {{ .Values.controller.keda.apiVersion }} |
| 5 | kind: ScaledObject |
| 6 | metadata: |
| 7 | labels: |
| 8 | {{- include "ingress-nginx.labels" . | nindent 4 }} |
| 9 | app.kubernetes.io/component: controller |
| 10 | name: {{ include "ingress-nginx.controller.fullname" . }} |
| 11 | {{- if .Values.controller.keda.scaledObject.annotations }} |
| 12 | annotations: {{ toYaml .Values.controller.keda.scaledObject.annotations | nindent 4 }} |
| 13 | {{- end }} |
| 14 | spec: |
| 15 | scaleTargetRef: |
| 16 | {{- if eq .Values.controller.keda.apiVersion "keda.k8s.io/v1alpha1" }} |
| 17 | deploymentName: {{ include "ingress-nginx.controller.fullname" . }} |
| 18 | {{- else if eq .Values.controller.keda.apiVersion "keda.sh/v1alpha1" }} |
| 19 | name: {{ include "ingress-nginx.controller.fullname" . }} |
| 20 | {{- end }} |
| 21 | pollingInterval: {{ .Values.controller.keda.pollingInterval }} |
| 22 | cooldownPeriod: {{ .Values.controller.keda.cooldownPeriod }} |
| 23 | minReplicaCount: {{ .Values.controller.keda.minReplicas }} |
| 24 | maxReplicaCount: {{ .Values.controller.keda.maxReplicas }} |
| 25 | triggers: |
| 26 | {{- with .Values.controller.keda.triggers }} |
| 27 | {{ toYaml . | indent 2 }} |
| 28 | {{ end }} |
| 29 | advanced: |
| 30 | restoreToOriginalReplicaCount: {{ .Values.controller.keda.restoreToOriginalReplicaCount }} |
| 31 | {{- if .Values.controller.keda.behavior }} |
| 32 | horizontalPodAutoscalerConfig: |
| 33 | behavior: |
| 34 | {{ with .Values.controller.keda.behavior -}} |
| 35 | {{ toYaml . | indent 8 }} |
| 36 | {{ end }} |
| 37 | |
| 38 | {{- end }} |
| 39 | {{- end }} |