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

Add security context to moon containers. #267

Merged
merged 1 commit into from
Jul 23, 2024
Merged
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
42 changes: 42 additions & 0 deletions moon2/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 4545
volumeMounts:
Expand Down Expand Up @@ -165,6 +171,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 4444
- name: moon-conf
Expand Down Expand Up @@ -202,6 +214,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
{{- if $basicAuth }}
{{- if not (eq $basicAuth "kubernetes") }}
- name: moon-ui-basic-auth
Expand Down Expand Up @@ -244,6 +262,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 8181
volumeMounts:
Expand Down Expand Up @@ -294,6 +318,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 9191
volumeMounts:
Expand Down Expand Up @@ -339,6 +369,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 9090
{{- end }}
Expand Down Expand Up @@ -380,6 +416,12 @@ spec:
{{- else -}}
{{- $def -}}
{{- end }}
{{- if .Values.deployment -}}
{{- with .Values.deployment.containerSecurityContext }}
securityContext:
{{ toYaml . | nindent 10 }}
{{- end }}
{{- end }}
ports:
- containerPort: 8080
volumes:
Expand Down
15 changes: 15 additions & 0 deletions moon2/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,21 @@ deployment:
securityContext: {}
# runAsUser: 1000

##
## Security context for containers running in Moon pod.
##
containerSecurityContext: {}
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - ALL
# privileged: false
# runAsGroup: 1000
# runAsNonRoot: true
# runAsUser: 1000
# seccompProfile:
# type: RuntimeDefault

##
## Optional fields that specifies the maximum number of pods that can be created over the desired number of pods
## and that can be unavailable during the update. You can use both int and percent values.
Expand Down
Loading