Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions helm/mysql-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@ spec:
labels:
{{- include "mysql-operator.deployment.podLabels" . | nindent 8 }}
spec:
{{- with .Values.podSecurityContext }}
securityContext:
runAsNonRoot: true
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.image.pullSecrets.enabled }}
imagePullSecrets:
- name: {{ .Values.image.pullSecrets.secretName }}
Expand Down Expand Up @@ -120,15 +122,10 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
capabilities:
drop:
- ALL
runAsUser: 2
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: mysqlsh-home
emptyDir: {}
Expand Down
21 changes: 21 additions & 0 deletions helm/mysql-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ envs:

replicas: 1

# Pod-level security context for the mysql-operator Pod.
# Required for Kubernetes restricted Pod Security Standard.
podSecurityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault

# Container-level security context for the mysql-operator container.
# Required for Kubernetes restricted Pod Security Standard.
containerSecurityContext:
capabilities:
drop:
- ALL
runAsUser: 2
allowPrivilegeEscalation: false
privileged: false
readOnlyRootFilesystem: true
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault

#deployment:
#name: mysql-operator
## deployment.name is part of the operator's persistent identity.
Expand Down