-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathdeployment.yaml
140 lines (140 loc) · 5.33 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
apiVersion: apps/v1
kind: Deployment
metadata:
{{- with (mergeOverwrite (deepCopy .Values.global.deploymentAnnotations) .Values.controller.deploymentAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
name: {{ include "argo-rollouts.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
labels:
{{- range $key, $value := (mergeOverwrite (deepCopy .Values.global.deploymentLabels) .Values.controller.deploymentLabels) }}
{{ $key }}: {{ $value | quote }}
{{- end }}
app.kubernetes.io/component: {{ .Values.controller.component }}
{{- include "argo-rollouts.labels" . | nindent 4 }}
spec:
selector:
matchLabels:
app.kubernetes.io/component: {{ .Values.controller.component }}
{{- include "argo-rollouts.selectorLabels" . | nindent 6 }}
strategy:
type: RollingUpdate
replicas: {{ .Values.controller.replicas }}
revisionHistoryLimit: {{ .Values.global.revisionHistoryLimit }}
template:
metadata:
{{- with (mergeOverwrite (deepCopy .Values.podAnnotations) .Values.controller.podAnnotations) }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
labels:
{{- include "argo-rollouts.selectorLabels" . | nindent 8 }}
app.kubernetes.io/component: {{ .Values.controller.component }}
{{- range $key, $value := (mergeOverwrite (deepCopy .Values.podLabels) .Values.controller.podLabels) }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "argo-rollouts.serviceAccountName" . }}
containers:
- image: "{{ .Values.controller.image.registry }}/{{ .Values.controller.image.repository }}:{{ default .Chart.AppVersion .Values.controller.image.tag }}"
args:
- --healthzPort={{ .Values.controller.containerPorts.healthz }}
- --metricsport={{ .Values.controller.containerPorts.metrics }}
- "--loglevel={{ .Values.controller.logging.level }}"
- "--logformat={{ .Values.controller.logging.format }}"
- "--kloglevel={{ .Values.controller.logging.kloglevel }}"
{{- if not .Values.clusterInstall }}
- --namespaced
{{- end }}
{{- if gt (int .Values.controller.replicas) 1 }}
- --leader-elect
{{- end }}
{{- with .Values.controller.extraArgs }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.extraEnv }}
env:
{{- toYaml . | nindent 8 }}
{{- end }}
imagePullPolicy: {{ .Values.controller.image.pullPolicy }}
name: argo-rollouts
ports:
- containerPort: {{ .Values.controller.containerPorts.metrics }}
name: metrics
- containerPort: {{ .Values.controller.containerPorts.healthz }}
name: healthz
livenessProbe:
{{- toYaml .Values.controller.livenessProbe | nindent 10 }}
readinessProbe:
{{- toYaml .Values.controller.readinessProbe | nindent 10 }}
securityContext:
{{- toYaml .Values.containerSecurityContext | nindent 10 }}
{{- with .Values.controller.lifecycle }}
lifecycle: {{ toYaml . | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.controller.resources | nindent 10 }}
volumeMounts:
- name: plugin-bin
mountPath: /home/argo-rollouts/plugin-bin
- name: tmp
mountPath: /tmp
{{- with .Values.controller.volumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.controller.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
{{- with .Values.controller.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.controller.nodeSelector }}
nodeSelector:
{{- toYaml .Values.controller.nodeSelector | nindent 8 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- with .Values.controller.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ . }}
{{- end }}
{{- if .Values.controller.tolerations }}
tolerations:
{{- toYaml .Values.controller.tolerations | nindent 8 }}
{{- end }}
{{- if .Values.controller.affinity }}
affinity:
{{- toYaml .Values.controller.affinity | nindent 8 }}
{{- end }}
{{- with .Values.controller.topologySpreadConstraints }}
topologySpreadConstraints:
{{- range $constraint := . }}
- {{ toYaml $constraint | nindent 8 | trim }}
{{- if not $constraint.labelSelector }}
labelSelector:
matchLabels:
app.kubernetes.io/component: {{ $.Values.controller.component }}
{{- include "argo-rollouts.selectorLabels" $ | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
{{- with .Values.controller.priorityClassName }}
priorityClassName: {{ . }}
{{- end }}
volumes:
- name: plugin-bin
emptyDir: {}
- name: tmp
emptyDir: {}
{{- with .Values.controller.volumes }}
{{- toYaml . | nindent 6 }}
{{- end }}