Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added securityContext on mattermost-operator helm chart deployment #340

Merged
merged 9 commits into from
Oct 4, 2023
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ spec:
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- args:
{{- if .Values.mattermostOperator.args }}
Expand All @@ -43,6 +45,8 @@ spec:
image: "{{ .Values.mattermostOperator.image.repository }}:{{ .Values.mattermostOperator.image.tag }}"
imagePullPolicy: "{{ .Values.mattermostOperator.image.pullPolicy }}"
name: {{ template "mattermost-operator.name" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
ports:
- containerPort: 8383
name: metrics
Expand Down
15 changes: 15 additions & 0 deletions charts/mattermost-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,3 +181,18 @@ mysqlOperator:
topology:
user: "b3JjaGVzdHJhdG9y"
password: "Nnc2NHBhaGJzUA=="


podSecurityContext:
runAsUser: 10001
runAsGroup: 10001
fsGroup: 10001

securityContext:
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 10001
runAsGroup: 10001