| 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 |
| Giorgi Lekveishvili | cccf72f | 2023-05-19 16:13:22 +0400 | [diff] [blame] | 10 | {{- with .Values.controller.labels }} |
| 11 | {{- toYaml . | nindent 4 }} |
| 12 | {{- end }} |
| Giorgi Lekveishvili | 725bb39 | 2023-05-05 18:24:27 +0400 | [diff] [blame] | 13 | name: {{ include "ingress-nginx.controller.fullname" . }} |
| 14 | {{- if .Values.controller.keda.scaledObject.annotations }} |
| 15 | annotations: {{ toYaml .Values.controller.keda.scaledObject.annotations | nindent 4 }} |
| 16 | {{- end }} |
| 17 | spec: |
| 18 | scaleTargetRef: |
| 19 | {{- if eq .Values.controller.keda.apiVersion "keda.k8s.io/v1alpha1" }} |
| 20 | deploymentName: {{ include "ingress-nginx.controller.fullname" . }} |
| 21 | {{- else if eq .Values.controller.keda.apiVersion "keda.sh/v1alpha1" }} |
| 22 | name: {{ include "ingress-nginx.controller.fullname" . }} |
| 23 | {{- end }} |
| 24 | pollingInterval: {{ .Values.controller.keda.pollingInterval }} |
| 25 | cooldownPeriod: {{ .Values.controller.keda.cooldownPeriod }} |
| 26 | minReplicaCount: {{ .Values.controller.keda.minReplicas }} |
| 27 | maxReplicaCount: {{ .Values.controller.keda.maxReplicas }} |
| 28 | triggers: |
| 29 | {{- with .Values.controller.keda.triggers }} |
| 30 | {{ toYaml . | indent 2 }} |
| 31 | {{ end }} |
| 32 | advanced: |
| 33 | restoreToOriginalReplicaCount: {{ .Values.controller.keda.restoreToOriginalReplicaCount }} |
| 34 | {{- if .Values.controller.keda.behavior }} |
| 35 | horizontalPodAutoscalerConfig: |
| 36 | behavior: |
| 37 | {{ with .Values.controller.keda.behavior -}} |
| 38 | {{ toYaml . | indent 8 }} |
| 39 | {{ end }} |
| 40 | |
| 41 | {{- end }} |
| 42 | {{- end }} |