1
+ apiVersion : apps/v1
2
+ kind : Deployment
3
+ metadata :
4
+ name : {{ .Release.Name }}-deployment
5
+ namespace : {{ .Values.namespace.name }}
6
+ labels :
7
+ app : {{ .Release.Name }}
8
+ spec :
9
+ replicas : {{ .Values.replicaCount }}
10
+ selector :
11
+ matchLabels :
12
+ app : {{ .Release.Name }}
13
+ template :
14
+ metadata :
15
+ labels :
16
+ app : {{ .Release.Name }}
17
+ spec :
18
+ securityContext :
19
+ runAsUser : {{ .Values.securityContext.runAsUser | default 999 }}
20
+ runAsGroup : {{ .Values.securityContext.runAsGroup | default 999 }}
21
+ automountServiceAccountToken : {{ .Values.automountServiceAccountToken | default false }}
22
+ containers :
23
+ - name : {{ .Chart.Name }}
24
+ image : " {{ .Values.image.repository }}:{{ .Values.image.tag }}"
25
+ imagePullPolicy : Always
26
+ ports :
27
+ - containerPort : {{ .Values.service.targetPort }}
28
+ {{- if .Values.env.enabled }}
29
+ env :
30
+ - name : APP_ENV
31
+ value : " {{ .Values.env.value }}"
32
+ {{- end }}
33
+ securityContext :
34
+ runAsUser : {{ .Values.securityContext.runAsUser | default 999 }}
35
+ runAsGroup : {{ .Values.securityContext.runAsGroup | default 999 }}
36
+ allowPrivilegeEscalation : {{ .Values.securityContext.allowPrivilegeEscalation | default false }}
37
+ readOnlyRootFilesystem : {{ .Values.securityContext.readOnlyRootFilesystem | default true }}
38
+ capabilities :
39
+ drop :
40
+ {{- range .Values.securityContext.capabilities.drop }}
41
+ - {{ . }}
42
+ {{- end }}
43
+ seccompProfile :
44
+ type : RuntimeDefault
45
+ {{- toYaml .Values.securityContext | nindent 12 }}
46
+ resources :
47
+ {{- toYaml .Values.resources | nindent 12 }}
48
+ {{- if .Values.probes.enabled }}
49
+ livenessProbe :
50
+ httpGet :
51
+ path : {{ .Values.probes.path }}
52
+ port : {{ .Values.service.targetPort }}
53
+ initialDelaySeconds : {{ .Values.probes.liveness.initialDelaySeconds }}
54
+ periodSeconds : {{ .Values.probes.liveness.periodSeconds }}
55
+ failureThreshold : {{ .Values.probes.liveness.failureThreshold }}
56
+ readinessProbe :
57
+ httpGet :
58
+ path : {{ .Values.probes.path }}
59
+ port : {{ .Values.service.targetPort }}
60
+ initialDelaySeconds : {{ .Values.probes.readiness.initialDelaySeconds }}
61
+ periodSeconds : {{ .Values.probes.readiness.periodSeconds }}
62
+ failureThreshold : {{ .Values.probes.readiness.failureThreshold }}
63
+ {{- end }}
0 commit comments