forked from openfaas/faas-netes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
autoscaler-dep.yaml
94 lines (92 loc) · 2.67 KB
/
autoscaler-dep.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{{- if .Values.autoscaler.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: {{ template "openfaas.name" . }}
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
component: autoscaler
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
name: autoscaler
namespace: {{ .Release.Namespace | quote }}
spec:
replicas: {{ .Values.autoscaler.replicas }}
selector:
matchLabels:
app: autoscaler
template:
metadata:
annotations:
prometheus.io/scrape: "false"
labels:
app: autoscaler
spec:
volumes:
{{- if .Values.basic_auth }}
- name: auth
secret:
secretName: basic-auth
{{- end }}
{{- if .Values.autoscaler.enabled }}
- name: license
secret:
secretName: openfaas-license
{{- end }}
containers:
- name: autoscaler
resources:
{{- .Values.autoscaler.resources | toYaml | nindent 12 }}
{{- if .Values.autoscaler.enabled }}
image: {{ .Values.autoscaler.image }}
{{- else }}
image: {{ .Values.autoscaler.image }}
{{- end }}
imagePullPolicy: {{ .Values.openfaasImagePullPolicy }}
{{- if .Values.autoscaler.enabled }}
command:
- "/usr/bin/autoscaler"
- "-license-file=/var/secrets/license/license"
{{- if eq (or .Values.autoscaler.disableHorizontalScaling false) true }}
- "-horizontal-scaling=false"
{{- end }}
{{- end }}
env:
- name: gateway_url
value: "http://gateway.{{ .Release.Namespace }}:8080/"
- name: prometheus_host
value: "prometheus.{{ .Release.Namespace }}"
- name: prometheus_port
value: "9090"
{{- if .Values.functionNamespace }}
- name: faas_function_suffix
value: ".{{ .Values.functionNamespace }}.svc.{{ .Values.kubernetesDNSDomain }}"
{{- end }}
{{- if .Values.basic_auth }}
- name: secret_mount_path
value: "/var/secrets/autoscaler"
- name: basic_auth
value: "{{ .Values.basic_auth }}"
volumeMounts:
{{- if .Values.autoscaler.enabled }}
- name: license
readOnly: true
mountPath: "/var/secrets/license"
{{- end }}
- name: auth
readOnly: true
mountPath: "/var/secrets/autoscaler"
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}