Skip to content

Commit

Permalink
Helm chart: container securityContext
Browse files Browse the repository at this point in the history
Make the kubernetes securityContext configurable on the container level (in addition to the already configurable securityContext on the pod level).

Fixes: vernemq#375
  • Loading branch information
hsudbrock authored and ioolkos committed Feb 21, 2024
1 parent e7db710 commit fb27023
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helm/vernemq/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
app.kubernetes.io/instance: {{ .Release.Name }}
{{- if .Values.statefulset.podLabels }}
{{ toYaml .Values.statefulset.podLabels | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.statefulset.podAnnotations }}
annotations:
{{ toYaml . | nindent 8 }}
Expand Down Expand Up @@ -147,6 +147,10 @@ spec:
lifecycle:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.containerSecurityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
Expand Down
6 changes: 6 additions & 0 deletions helm/vernemq/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,17 @@ tolerations: []
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
podAntiAffinity: soft

# Security context (for the pods)
securityContext:
runAsUser: 10000
runAsGroup: 10000
fsGroup: 10000

# Security context (for the containers, uncomment if needed; default is no specific container-level security context)
# containerSecurityContext:
# privileged: ...
# ...

## If RBAC is enabled on the cluster,VerneMQ needs a service account
## with permissisions sufficient to list pods
rbac:
Expand Down

0 comments on commit fb27023

Please sign in to comment.