File tree Expand file tree Collapse file tree 3 files changed +28
-7
lines changed
deploy/charts/mysql-operator Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77
88## [ Unreleased]
99### Added
10+ * Add ` orchestrator.persistence.fsGroupWorkaroundEnabled ` for persistent volume
11+ provisioners wich don't support fsGroup in security context (fixes #615 )
1012### Changed
13+ * Allow setting pod security context when deploying with Helm
1114 * Use [ distroless] ( https://github.com/GoogleContainerTools/distroless ) as base image for orchestrator container
1215### Removed
1316### Fixed
Original file line number Diff line number Diff line change 3333 - name : operator
3434 image : " {{ .Values.image }}"
3535 imagePullPolicy : {{ .Values.imagePullPolicy }}
36- securityContext :
37- runAsUser : 888
3836 env :
3937 - name : ORC_TOPOLOGY_USER
4038 valueFrom :
9391 secretRef :
9492 name : {{ template "mysql-operator.orc-secret-name" . }}
9593 volumeMounts :
94+ - name : data
95+ mountPath : /var/lib/orchestrator
9696 - name : config
97- mountPath : /usr/local/share/orchestrator/templates/
97+ mountPath : /usr/local/share/orchestrator/templates
9898 livenessProbe :
9999 timeoutSeconds : 10
100100 initialDelaySeconds : 200
@@ -118,17 +118,24 @@ spec:
118118 - name : data
119119 emptyDir : {}
120120 {{- end }}
121+
122+ {{- if .Values.orchestrator.persistence.fsGroupWorkaroundEnabled }}
121123 initContainers :
122124 - name : init-mount
125+ securityContext :
126+ runAsUser : 0
123127 image : busybox:1.34.0
124- command : ['sh', '-c', "chown -R 777:777 /var/lib/orchestrator"]
128+ command : ['sh', '-c', "chown -R {{ .Values.securityContext.fsGroup | default "0" }}:{{ .Values.securityContext.fsGroup | default "0" }} /var/lib/orchestrator"]
125129 volumeMounts :
126130 - name : data
127- mountPath : /var/lib/orchestrator/
131+ mountPath : /var/lib/orchestrator
132+ {{- end }}
128133
129134 # security context to mount corectly the volume for orc
135+ {{- with .Values.securityContext }}
130136 securityContext :
131- fsGroup : 777
137+ {{- toYaml . | nindent 8 }}
138+ {{- end }}
132139
133140 {{- with .Values.nodeSelector }}
134141 nodeSelector :
Original file line number Diff line number Diff line change @@ -49,6 +49,13 @@ resources: {}
4949 # cpu: 100m
5050 # memory: 128Mi
5151
52+ securityContext :
53+ runAsNonRoot : true
54+ # 65532 is the UID for nonroot user from distroless image
55+ runAsUser : 65532
56+ runAsGroup : 65532
57+ fsGroup : 65532
58+
5259# # nodeAffinity settings
5360# nodeAffinity:
5461# requiredDuringSchedulingIgnoredDuringExecution:
@@ -130,6 +137,10 @@ orchestrator:
130137 # storageClass: "-"
131138 accessMode : " ReadWriteOnce"
132139 size : 1Gi
140+ # inject an init container which properly sets the ownership for the orchestrator's data volume
141+ # this is needed when the PV provisioner does not properly sets permissions for fsGroup
142+ # when enabling this, you MUST change the securityContext.runAsNonRoot to false
143+ fsGroupWorkaroundEnabled : false
133144
134145 # key value map of orchestrator conf directives.
135146 # see: https://github.com/github/orchestrator/blob/master/conf/orchestrator-sample.conf.json
@@ -179,7 +190,7 @@ orchestrator:
179190 # for more information about template: https://github.com/github/orchestrator/blob/master/go/logic/topology_recovery.go#L256
180191 ProcessesShellCommand : " sh"
181192
182- OnFailureDetectionProcesses :
193+ OnFailureDetectionProcesses :
183194 - " /usr/local/bin/orc-helper event -w '{failureClusterAlias}' 'OrcFailureDetection' 'Failure: {failureType}, failed host: {failedHost}, lost replcas: {lostReplicas}' || true"
184195 - " /usr/local/bin/orc-helper failover-in-progress '{failureClusterAlias}' '{failureDescription}' || true"
185196
You can’t perform that action at this time.
0 commit comments