|
| 1 | +{{/* |
| 2 | +Copyright 2021 HAProxy Technologies LLC |
| 3 | + |
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | + |
| 8 | + http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + |
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/}} |
| 16 | + |
| 17 | +{{- if and (eq .Values.kind "Deployment") .Values.keda.enabled }} |
| 18 | +apiVersion: keda.sh/v1alpha1 |
| 19 | +kind: ScaledObject |
| 20 | +metadata: |
| 21 | + name: {{ include "haproxy.fullname" . }} |
| 22 | + labels: |
| 23 | + {{- include "haproxy.labels" . | nindent 4 }} |
| 24 | + {{- if .Values.keda.scaledObject.annotations }} |
| 25 | + annotations: {{ toYaml .Values.keda.scaledObject.annotations | nindent 4 }} |
| 26 | + {{- end }} |
| 27 | +spec: |
| 28 | + scaleTargetRef: |
| 29 | + apiVersion: apps/v1 |
| 30 | + kind: Deployment |
| 31 | + name: {{ include "haproxy.fullname" . }} |
| 32 | + pollingInterval: {{ .Values.keda.pollingInterval }} |
| 33 | + cooldownPeriod: {{ .Values.keda.cooldownPeriod }} |
| 34 | + minReplicaCount: {{ .Values.keda.minReplicas }} |
| 35 | + maxReplicaCount: {{ .Values.keda.maxReplicas }} |
| 36 | + triggers: |
| 37 | +{{- with .Values.keda.triggers }} |
| 38 | +{{ toYaml . | indent 2 }} |
| 39 | +{{ end }} |
| 40 | + advanced: |
| 41 | + restoreToOriginalReplicaCount: {{ .Values.keda.restoreToOriginalReplicaCount }} |
| 42 | +{{- if .Values.keda.behavior }} |
| 43 | + horizontalPodAutoscalerConfig: |
| 44 | + behavior: |
| 45 | +{{ with .Values.keda.behavior -}} |
| 46 | +{{ toYaml . | indent 8 }} |
| 47 | +{{ end }} |
| 48 | +{{- end }} |
| 49 | +{{- end }} |
0 commit comments