-
Notifications
You must be signed in to change notification settings - Fork 523
/
Copy pathkeda-autoscaling.yaml
78 lines (78 loc) · 2.66 KB
/
keda-autoscaling.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
{{- if $.Values.kedaAutoscaling.enabled }}
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
{{- if $.Values.kedaAutoscaling.name }}
name: {{ $.Values.kedaAutoscaling.name }}
{{- else }}
name: {{ template ".Chart.Name .fullname" $ }}-keda
{{- end }}
labels:
app: {{ template ".Chart.Name .name" $ }}
chart: {{ template ".Chart.Name .chart" $ }}
release: {{ $.Release.Name }}
appId: {{ $.Values.app | quote }}
envId: {{ $.Values.env | quote }}
release: {{ .Release.Name }}
{{- if .Values.appLabels }}
{{ toYaml .Values.appLabels | indent 4 }}
{{- end }}
{{- if .Values.kedaAutoscaling.labels }}
{{ toYaml .Values.kedaAutoscaling.labels | indent 4 }}
{{- end }}
{{- if .Values.kedaAutoscaling.annotations }}
annotations:
{{ toYaml .Values.kedaAutoscaling.annotations | indent 4 }}
{{- end }}
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ include ".Chart.Name .fullname" $ }}
{{- if $.Values.kedaAutoscaling.envSourceContainerName }}
envSourceContainerName: {{ $.Values.kedaAutoscaling.envSourceContainerName }}
{{- end }}
{{- if $.Values.kedaAutoscaling.pollingInterval }}
pollingInterval: {{ $.Values.kedaAutoscaling.pollingInterval }}
{{- end }}
{{- if $.Values.kedaAutoscaling.cooldownPeriod }}
cooldownPeriod: {{ $.Values.kedaAutoscaling.cooldownPeriod }}
{{- end }}
{{- if $.Values.kedaAutoscaling.idleReplicaCount }}
idleReplicaCount: {{ $.Values.kedaAutoscaling.idleReplicaCount }}
{{- end }}
minReplicaCount: {{ $.Values.kedaAutoscaling.minReplicaCount }}
maxReplicaCount: {{ $.Values.kedaAutoscaling.maxReplicaCount }}
{{- if $.Values.kedaAutoscaling.fallback }}
fallback:
{{ toYaml $.Values.kedaAutoscaling.fallback | indent 4 }}
{{- end }}
{{- if $.Values.kedaAutoscaling.advanced }}
advanced:
{{ toYaml $.Values.kedaAutoscaling.advanced | indent 4 }}
{{- end }}
triggers:
{{ toYaml .Values.kedaAutoscaling.triggers | indent 2}}
{{- if $.Values.kedaAutoscaling.authenticationRef }}
authenticationRef:
{{ toYaml $.Values.kedaAutoscaling.authenticationRef | indent 6 }}
{{- end }}
---
{{- if $.Values.kedaAutoscaling.triggerAuthentication.enabled }}
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: {{ $.Values.kedaAutoscaling.triggerAuthentication.name }}
labels:
app: {{ template ".Chart.Name .name" $ }}
chart: {{ template ".Chart.Name .chart" $ }}
release: {{ $.Release.Name }}
appId: {{ $.Values.app | quote }}
envId: {{ $.Values.env | quote }}
{{- if .Values.appLabels }}
{{ toYaml .Values.appLabels | indent 4 }}
{{- end }}
spec:
{{ toYaml $.Values.kedaAutoscaling.triggerAuthentication.spec | indent 2 }}
{{- end }}
{{- end }}