forked from helm/charts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeployment.yaml
122 lines (118 loc) · 3.94 KB
/
deployment.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "envoy.fullname" . }}
labels:
app: {{ template "envoy.name" . }}
chart: {{ template "envoy.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ template "envoy.name" . }}
release: {{ .Release.Name }}
strategy:
{{ .Values.strategy | nindent 4 }}
template:
metadata:
labels:
app: {{ template "envoy.name" . }}
release: {{ .Release.Name }}
component: controller
{{- if .Values.podLabels }}
## Custom pod labels
{{- range $key, $value := .Values.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
annotations:
checksum/config: {{ include (print .Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
## Custom pod annotations
{{- range $key, $value := .Values.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
spec:
securityContext:
{{ toYaml .Values.securityContext | nindent 8 }}
{{- if .Values.priorityClassName }}
priorityClassName: "{{ .Values.priorityClassName }}"
{{- end }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- if .Values.initContainersTemplate }}
initContainers:
{{ tpl .Values.initContainersTemplate $ | nindent 8 }}
{{- end }}
containers:
- name: envoy
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
{{ toYaml .Values.command | nindent 12 }}
args:
{{- if $.Values.argsTemplate }}
{{ tpl $.Values.argsTemplate $ | nindent 12}}
{{- else }}
{{ toYaml .Values.args | nindent 12 }}
{{- end }}
ports:
{{- with .Values.ports }}
{{- range $key, $port := . }}
- name: {{ $key }}
{{ toYaml $port | nindent 14 }}
{{- end }}
{{- end }}
livenessProbe:
{{ toYaml .Values.livenessProbe | nindent 12 }}
readinessProbe:
{{ toYaml .Values.readinessProbe | nindent 12 }}
env:
{{- range $key, $value := .Values.env }}
- name: {{ $key | upper | replace "." "_" }}
value: {{ $value | quote }}
{{- end }}
resources:
{{ toYaml .Values.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /config
{{- if .Values.volumeMounts }}
{{ toYaml .Values.volumeMounts | nindent 12 }}
{{- end }}
{{- range $key, $value := .Values.secretMounts }}
- name: {{ $key }}
mountPath: {{ $value.mountPath }}
{{- end }}
lifecycle:
{{ toYaml .Values.lifecyle | nindent 12 }}
{{- if .Values.sidecarContainersTemplate }}
{{ tpl .Values.sidecarContainersTemplate $ | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | nindent 8 }}
{{- end }}
volumes:
- name: config
configMap:
name: {{ template "envoy.fullname" . }}
{{- if .Values.volumes }}
{{ toYaml .Values.volumes | nindent 8 }}
{{- end }}
{{- range $key, $value := .Values.secretMounts }}
- name: {{ $key }}
secret:
secretName: {{ $value.secretName }}
defaultMode: {{ $value.defaultMode }}
{{- end }}