@@ -22,10 +22,83 @@ spec:
2222 {{- toYaml . | nindent 8 }}
2323 {{- end }}
2424 spec :
25+ {{- if .Values.openshift.enabled }}
26+ serviceAccountName : {{ .Values.openshift.serviceAccount.name }}
27+ # OpenShift-compatible pod security context
28+ securityContext :
29+ {{- if .Values.openshift.securityContext.pod.runAsNonRoot }}
30+ runAsNonRoot : {{ .Values.openshift.securityContext.pod.runAsNonRoot }}
31+ {{- end }}
32+ {{- if .Values.openshift.securityContext.pod.runAsUser }}
33+ runAsUser : {{ .Values.openshift.securityContext.pod.runAsUser }}
34+ {{- end }}
35+ {{- if .Values.openshift.securityContext.pod.runAsGroup }}
36+ runAsGroup : {{ .Values.openshift.securityContext.pod.runAsGroup }}
37+ {{- end }}
38+ {{- if .Values.openshift.securityContext.pod.fsGroup }}
39+ fsGroup : {{ .Values.openshift.securityContext.pod.fsGroup }}
40+ {{- end }}
41+ seccompProfile :
42+ type : RuntimeDefault
43+ {{- else }}
44+ # Standard Kubernetes security context
45+ securityContext :
46+ {{- if .Values.securityContext.standard.pod.runAsNonRoot }}
47+ runAsNonRoot : {{ .Values.securityContext.standard.pod.runAsNonRoot }}
48+ {{- end }}
49+ {{- if .Values.securityContext.standard.pod.runAsUser }}
50+ runAsUser : {{ .Values.securityContext.standard.pod.runAsUser }}
51+ {{- end }}
52+ {{- if .Values.securityContext.standard.pod.runAsGroup }}
53+ runAsGroup : {{ .Values.securityContext.standard.pod.runAsGroup }}
54+ {{- end }}
55+ {{- if .Values.securityContext.standard.pod.fsGroup }}
56+ fsGroup : {{ .Values.securityContext.standard.pod.fsGroup }}
57+ {{- end }}
58+ seccompProfile :
59+ type : RuntimeDefault
60+ {{- end }}
2561 containers :
2662 - name : permitio-pdp
2763 image : " {{ .Values.pdp.image.repository }}:{{ .Values.pdp.image.tag }}"
2864 imagePullPolicy : {{ .Values.pdp.image.pullPolicy }}
65+ {{- if .Values.openshift.enabled }}
66+ # OpenShift-compatible container security context
67+ securityContext :
68+ allowPrivilegeEscalation : false
69+ capabilities :
70+ drop :
71+ - ALL
72+ {{- if .Values.openshift.securityContext.container.runAsNonRoot }}
73+ runAsNonRoot : {{ .Values.openshift.securityContext.container.runAsNonRoot }}
74+ {{- end }}
75+ {{- if .Values.openshift.securityContext.container.runAsUser }}
76+ runAsUser : {{ .Values.openshift.securityContext.container.runAsUser }}
77+ {{- end }}
78+ {{- if .Values.openshift.securityContext.container.runAsGroup }}
79+ runAsGroup : {{ .Values.openshift.securityContext.container.runAsGroup }}
80+ {{- end }}
81+ seccompProfile :
82+ type : RuntimeDefault
83+ {{- else }}
84+ # Standard Kubernetes container security context
85+ securityContext :
86+ allowPrivilegeEscalation : false
87+ capabilities :
88+ drop :
89+ - ALL
90+ {{- if .Values.securityContext.standard.container.runAsNonRoot }}
91+ runAsNonRoot : {{ .Values.securityContext.standard.container.runAsNonRoot }}
92+ {{- end }}
93+ {{- if .Values.securityContext.standard.container.runAsUser }}
94+ runAsUser : {{ .Values.securityContext.standard.container.runAsUser }}
95+ {{- end }}
96+ {{- if .Values.securityContext.standard.container.runAsGroup }}
97+ runAsGroup : {{ .Values.securityContext.standard.container.runAsGroup }}
98+ {{- end }}
99+ seccompProfile :
100+ type : RuntimeDefault
101+ {{- end }}
29102 ports :
30103 - containerPort : {{ .Values.pdp.port }}
31104 env :
@@ -90,10 +163,16 @@ spec:
90163 port : 7000
91164 initialDelaySeconds : 10
92165 periodSeconds : 10
93- {{- if .Values.pdp.logs_forwarder.enabled }}
94166 volumeMounts :
167+ {{- if .Values.pdp.logs_forwarder.enabled }}
95168 - name : logs
96169 mountPath : /tmp/
170+ {{- else if .Values.openshift.enabled }}
171+ # OpenShift filesystem permissions volume mounts
172+ - name : tmp-volume
173+ mountPath : /tmp
174+ - name : opa-volume
175+ mountPath : /opa
97176 {{- end }}
98177 {{- if .Values.pdp.logs_forwarder.enabled }}
99178 - name : fluentbit
@@ -110,11 +189,17 @@ spec:
110189 fieldRef :
111190 fieldPath : metadata.labels['app']
112191 {{- end }}
113- {{- if .Values.pdp.logs_forwarder.enabled }}
114192 volumes :
193+ {{- if .Values.pdp.logs_forwarder.enabled }}
115194 - name : fluent-bit-config
116195 configMap :
117196 name : fluentbit-config
118197 - name : logs
119198 emptyDir : {}
199+ {{- else if .Values.openshift.enabled }}
200+ # OpenShift filesystem permissions volumes
201+ - name : tmp-volume
202+ emptyDir : {}
203+ - name : opa-volume
204+ emptyDir : {}
120205 {{- end }}
0 commit comments