controller-keda.yaml 1.6 KB

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