-
Notifications
You must be signed in to change notification settings - Fork 147
Expand file tree
/
Copy pathdeployment.yaml
More file actions
149 lines (149 loc) · 7.31 KB
/
deployment.yaml
File metadata and controls
149 lines (149 loc) · 7.31 KB
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
141
142
143
144
145
146
147
148
149
---
{{- if .Values.fetchmail.enabled }}
apiVersion: {{ include "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ printf "%s-fetchmail" (include "mailu.fullname" .) }}
namespace: {{ include "common.names.namespace" . | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: fetchmail
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
replicas: 1
{{- if .Values.fetchmail.updateStrategy }}
strategy: {{- toYaml .Values.fetchmail.updateStrategy | nindent 4 }}
{{- end }}
revisionHistoryLimit: {{ .Values.fetchmail.revisionHistoryLimit }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
app.kubernetes.io/component: fetchmail
template:
metadata:
labels: {{- include "common.labels.standard" . | nindent 8 }}
app.kubernetes.io/component: fetchmail
{{- if .Values.fetchmail.podLabels }}
{{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.podLabels "context" $) | nindent 8 }}
{{- end }}
annotations:
checksum/envvars-configmap.yaml: {{ include (print .Template.BasePath "/envvars-configmap.yaml") . | sha256sum }}
{{- if .Values.fetchmail.podAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.fetchmail.podAnnotations "context" $) | nindent 8 }}
{{- end }}
spec:
{{- include "common.images.pullSecrets" (dict "images" (list .Values.fetchmail.image) "global" .Values.global) | nindent 6 }}
{{- if .Values.fetchmail.hostAliases }}
hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.hostAliases "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.nodeSelector }}
nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.nodeSelector "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.affinity }}
affinity: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.affinity "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.tolerations }}
tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.tolerations "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.priorityClassName }}
priorityClassName: {{ .Values.fetchmail.priorityClassName | quote }}
{{- end }}
{{- if .Values.fetchmail.schedulerName }}
schedulerName: {{ .Values.fetchmail.schedulerName | quote }}
{{- end }}
{{- if .Values.fetchmail.topologySpreadConstraints }}
topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.topologySpreadConstraints "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.fetchmail.terminationGracePeriodSeconds }}
{{- end }}
{{- if .Values.fetchmail.initContainers }}
initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.initContainers "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.fetchmail.podSecurityContext.enabled }}
securityContext: {{- omit .Values.fetchmail.podSecurityContext "enabled" | toYaml | nindent 8 }}
{{- end }}
containers:
- name: fetchmail
image: {{ .Values.imageRegistry }}/{{ .Values.fetchmail.image.repository }}:{{ default (include "mailu.version" .) .Values.fetchmail.image.tag }}
imagePullPolicy: {{ .Values.fetchmail.image.pullPolicy }}
{{- if .Values.fetchmail.containerSecurityContext.enabled }}
securityContext: {{- omit .Values.fetchmail.containerSecurityContext "enabled" | toYaml | nindent 12 }}
{{- end }}
volumeMounts:
- name: data
subPath: fetchmail
mountPath: /data
{{- if .Values.fetchmail.extraVolumeMounts }}
{{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.extraVolumeMounts "context" $) | nindent 12 }}
{{- end }}
env:
- name: DEBUG
{{- if eq (default .Values.logLevel .Values.fetchmail.logLevel) "DEBUG" }}
value: "True"
{{- else }}
value: "False"
{{- end }}
{{- tpl (include "mailu.envvars.secrets" .) $ | nindent 12 }}
{{- if .Values.fetchmail.extraEnvVars }}
{{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.extraEnvVars "context" $) | nindent 12 }}
{{- end }}
envFrom:
- configMapRef:
name: {{ printf "%s-envvars" (include "mailu.fullname" .) }}
{{- if .Values.fetchmail.extraEnvVarsCM }}
- configMapRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.fetchmail.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.fetchmail.extraEnvVarsSecret }}
- secretRef:
name: {{ include "common.tplvalues.render" (dict "value" .Values.fetchmail.extraEnvVarsSecret "context" $) }}
{{- end }}
ports:
- name: fetchmail
containerPort: 5232
protocol: TCP
- name: http
containerPort: 80
protocol: TCP
{{- if .Values.fetchmail.resources }}
resources: {{- toYaml .Values.fetchmail.resources | nindent 12 }}
{{- end }}
{{- if .Values.fetchmail.startupProbe.enabled }}
startupProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.fetchmail.startupProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'ps ax | grep [/]fetchmail.py'
{{- end }}
{{- if .Values.fetchmail.livenessProbe.enabled }}
livenessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.fetchmail.livenessProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'ps ax | grep [/]fetchmail.py'
{{- end }}
{{- if .Values.fetchmail.readinessProbe.enabled }}
readinessProbe: {{- include "common.tplvalues.render" (dict "value" (omit .Values.fetchmail.readinessProbe "enabled") "context" $) | nindent 12 }}
exec:
command:
- sh
- -c
- 'ps ax | grep [/]fetchmail.py'
{{- end }}
{{- if .Values.fetchmail.extraContainers }}
{{- toYaml .Values.fetchmail.extraContainers | nindent 8 }}
{{- end }}
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ include "mailu.fetchmail.claimName" . }}
{{- if .Values.fetchmail.extraVolumes }}
{{- include "common.tplvalues.render" (dict "value" .Values.fetchmail.extraVolumes "context" $) | nindent 8 }}
{{- end }}
{{- end }}