Skip to content

Commit 2eaf1b3

Browse files
authored
Merge pull request #136 from marklogic/bug/CLD-782-volume-owner
CLD-782 : add podSecurityContext for volume auth
2 parents 58719f2 + 84f5c3d commit 2eaf1b3

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

charts/templates/statefulset.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ spec:
1818
labels:
1919
{{- include "marklogic.selectorLabels" . | nindent 8 }}
2020
spec:
21+
{{- if .Values.podSecurityContext.enabled }}
22+
securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }}
23+
{{- end }}
2124
serviceAccountName: {{ include "marklogic.serviceAccountName" . }}
2225
{{- with .Values.affinity }}
2326
affinity: {{- toYaml . | nindent 8}}

charts/values.yaml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,20 @@ networkPolicy:
205205
endPort: 8020
206206
protocol: TCP
207207

208-
## Below are the security configurations for container, by default security will be enabled
208+
## Below are the security configuration at POD level, by default security will be enabled
209+
## https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#configure-volume-permission-and-ownership-change-policy-for-pods
210+
#######################################################################################
211+
## NOTE : The POD Security context should be set when using additional volume. ##
212+
## This will ensure that additional volume created is set with the right ownership. ##
213+
#######################################################################################
214+
215+
podSecurityContext:
216+
enabled: true
217+
## group id of user owning the MarkLogic service
218+
fsGroup: 2
219+
fsGroupChangePolicy: "OnRootMismatch"
220+
221+
## Below are the security configurations for markLogic container, by default security will be enabled
209222
containerSecurityContext:
210223
enabled: true
211224
runAsUser: 1000

0 commit comments

Comments
 (0)