Skip to content

Commit 1b2f1ee

Browse files
Add specific securityContext for containers in OpenShift environment. (#3693)
* Add specific securityContext for containers in OpenShift environment. * Update _operator-dep.tpl Co-authored-by: Ryan Eberhard <[email protected]>
1 parent 306224c commit 1b2f1ee

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

kubernetes/charts/weblogic-operator/templates/_operator-dep.tpl

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,15 @@ spec:
106106
{{- if .memoryLimits}}
107107
memory: {{ .memoryLimits }}
108108
{{- end }}
109+
{{- if (eq ( .kubernetesPlatform | default "Generic" ) "OpenShift") }}
110+
securityContext:
111+
allowPrivilegeEscalation: false
112+
capabilities:
113+
drop: ["ALL"]
114+
runAsNonRoot: true
115+
seccompProfile:
116+
type: RuntimeDefault
117+
{{- end }}
109118
volumeMounts:
110119
- name: "weblogic-operator-cm-volume"
111120
mountPath: "/deployment/config"
@@ -306,6 +315,15 @@ spec:
306315
{{- if .memoryLimits}}
307316
memory: {{ .memoryLimits }}
308317
{{- end }}
318+
{{- if (eq ( .kubernetesPlatform | default "Generic") "OpenShift") }}
319+
securityContext:
320+
allowPrivilegeEscalation: false
321+
capabilities:
322+
drop: ["ALL"]
323+
runAsNonRoot: true
324+
seccompProfile:
325+
type: RuntimeDefault
326+
{{- end }}
309327
volumeMounts:
310328
- name: "weblogic-webhook-cm-volume"
311329
mountPath: "/deployment/config"

0 commit comments

Comments
 (0)