File tree 4 files changed +48
-12
lines changed
4 files changed +48
-12
lines changed Original file line number Diff line number Diff line change @@ -62,10 +62,14 @@ spec:
62
62
resources :
63
63
{{- toYaml . | nindent 10 }}
64
64
{{- end }}
65
+ {{- with .Values.containerSecurityContext }}
66
+ securityContext :
67
+ {{- toYaml . | nindent 10 }}
68
+ {{- end }}
69
+ {{- with .Values.podSecurityContext }}
65
70
securityContext :
66
- runAsUser : 333333
67
- runAsGroup : 333333
68
- fsGroup : 333333
71
+ {{- toYaml . | nindent 8 }}
72
+ {{- end }}
69
73
volumes :
70
74
{{- if and (.Values.trow.user) (.Values.trow.password) }}
71
75
- name : trow-pass
Original file line number Diff line number Diff line change 30
30
- |
31
31
cp /etc/trow/webhook-cert-ecc/tls.crt /etc/trow/webhook-cert/cert && \
32
32
openssl pkcs8 -topk8 -nocrypt -in /etc/trow/webhook-cert-ecc/tls.key -out /etc/trow/webhook-cert/key
33
+ {{- with .Values.containerSecurityContext }}
34
+ securityContext :
35
+ {{- toYaml . | nindent 10 }}
36
+ {{- end }}
33
37
volumeMounts :
34
38
- name : webhook-cert-translated
35
39
mountPath : /etc/trow/webhook-cert
53
57
ports :
54
58
- name : webhook
55
59
containerPort : 8443
60
+ {{- with .Values.containerSecurityContext }}
61
+ securityContext :
62
+ {{- toYaml . | nindent 10 }}
63
+ {{- end }}
56
64
volumeMounts :
57
65
- name : webhook-cert-translated
58
66
mountPath : /etc/trow/webhook-cert
63
71
subPath : config.yaml
64
72
readOnly : true
65
73
{{- end}}
74
+ {{- with .Values.podSecurityContext }}
75
+ securityContext :
76
+ {{- toYaml . | nindent 8 }}
77
+ {{- end }}
66
78
volumes :
67
79
- name : webhook-cert-ecc
68
80
secret :
Original file line number Diff line number Diff line change @@ -135,14 +135,16 @@ spec:
135
135
valueFrom :
136
136
fieldRef :
137
137
fieldPath : metadata.namespace
138
+ {{- with .Values.webhooks.tls.patch.containerSecurityContext }}
138
139
securityContext :
139
- allowPrivilegeEscalation : false
140
+ {{- toYaml . | nindent 12 }}
141
+ {{- end }}
140
142
restartPolicy : OnFailure
141
143
serviceAccountName : {{ include "trow.fullname" . }}-webhooks-tls
144
+ {{- with .Values.webhooks.tls.patch.podSecurityContext }}
142
145
securityContext :
143
- runAsNonRoot : true
144
- runAsUser : 2000
145
- fsGroup : 2000
146
+ {{- toYaml . | nindent 8 }}
147
+ {{- end }}
146
148
---
147
149
apiVersion : batch/v1
148
150
kind : Job
@@ -184,8 +186,10 @@ spec:
184
186
valueFrom :
185
187
fieldRef :
186
188
fieldPath : metadata.namespace
189
+ {{- with .Values.webhooks.tls.patch.containerSecurityContext }}
187
190
securityContext :
188
- allowPrivilegeEscalation : false
191
+ {{- toYaml . | nindent 12 }}
192
+ {{- end }}
189
193
{{- end }}
190
194
{{- if .Values.trow.proxyRegistries.webhook.enabled }}
191
195
- name : patch-mutation
@@ -203,13 +207,15 @@ spec:
203
207
valueFrom :
204
208
fieldRef :
205
209
fieldPath : metadata.namespace
210
+ {{- with .Values.webhooks.tls.patch.containerSecurityContext }}
206
211
securityContext :
207
- allowPrivilegeEscalation : false
212
+ {{- toYaml . | nindent 12 }}
213
+ {{- end }}
208
214
{{- end }}
209
215
restartPolicy : OnFailure
210
216
serviceAccountName : {{ include "trow.fullname" . }}-webhooks-tls
217
+ {{- with .Values.webhooks.tls.patch.podSecurityContext }}
211
218
securityContext :
212
- runAsNonRoot : true
213
- runAsUser : 2000
214
- fsGroup : 2000
219
+ {{- toYaml . | nindent 8 }}
220
+ {{- end }}
215
221
{{- end -}}
Original file line number Diff line number Diff line change 9
9
tag :
10
10
pullPolicy : IfNotPresent
11
11
12
+ # # Applies to the Trow Statefulset and the webhooks Deployment
13
+ podSecurityContext :
14
+ runAsUser : 333333
15
+ runAsGroup : 333333
16
+ fsGroup : 333333
17
+
18
+ containerSecurityContext : {}
19
+
12
20
trow :
13
21
# # if using NodePort, this can be set to 127.0.0.1:XXXX
14
22
# # Where "XXXX" is the value of service.nodePort
@@ -76,6 +84,12 @@ webhooks:
76
84
image :
77
85
image : registry.k8s.io/ingress-nginx/kube-webhook-certgen:v1.4.4@sha256:a9f03b34a3cbfbb26d103a14046ab2c5130a80c3d69d526ff8063d2b37b9fd3f
78
86
pullPolicy : IfNotPresent
87
+ podSecurityContext :
88
+ runAsNonRoot : true
89
+ runAsUser : 2000
90
+ fsGroup : 2000
91
+ containerSecurityContext :
92
+ allowPrivilegeEscalation : false
79
93
# # Use an existing secret that contains tls.crt and tls.key
80
94
existingSecretRef : ~
81
95
You can’t perform that action at this time.
0 commit comments