Skip to content

Commit e6c0a80

Browse files
committed
helm: add deployment securityContext values
1 parent b46d0d6 commit e6c0a80

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

helm/templates/coder.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ spec:
2626
labels:
2727
{{- include "coder.labels" . | nindent 8 }}
2828
spec:
29+
securityContext: {{ toYaml .Values.coder.podSecurityContext | nindent 8 }}
2930
serviceAccountName: {{ .Values.coder.serviceAccount.name | quote }}
3031
restartPolicy: Always
3132
{{- with .Values.coder.image.pullSecrets }}
@@ -48,6 +49,7 @@ spec:
4849
{{- with .Values.coder.initContainers }}
4950
initContainers:
5051
{{ toYaml . | nindent 8 }}
52+
securityContext: {{ toYaml .Values.coder.securityContext | nindent 12 }}
5153
{{- end }}
5254
containers:
5355
- name: coder
@@ -107,6 +109,7 @@ spec:
107109
{{- end }}
108110
{{- end }}
109111
{{- end }}
112+
securityContext: {{ toYaml .Values.coder.securityContext | nindent 12 }}
110113
readinessProbe:
111114
httpGet:
112115
path: /api/v2/buildinfo

helm/values.yaml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,53 @@ coder:
5050
# coder.serviceAccount.name -- The service account name
5151
name: coder
5252

53+
# coder.podSecurityContext -- Fields related to the pod's security context
54+
# (as opposed to the container). Some fields are also present in the
55+
# container security context, which will take precedence over these values.
56+
podSecurityContext:
57+
# coder.podSecurityContext.runAsNonRoot -- Requires that containers in
58+
# the pod run as an unprivileged user. If setting runAsUser to 0 (root),
59+
# this will need to be set to false.
60+
runAsNonRoot: true
61+
# coder.podSecurityContext.runAsUser -- Sets the user id of the pod.
62+
# For security reasons, we recommend using a non-root user.
63+
runAsUser: 1000
64+
# coder.podSecurityContext.runAsGroup -- Sets the group id of the pod.
65+
# For security reasons, we recommend using a non-root group.
66+
runAsGroup: 1000
67+
# coder.podSecurityContext.seccompProfile -- Sets the seccomp profile
68+
# for the pod. If set, the container security context setting will take
69+
# precedence over this value.
70+
seccompProfile:
71+
type: RuntimeDefault
72+
73+
# coder.securityContext -- Fields related to the container's security
74+
# context (as opposed to the pod). Some fields are also present in the pod
75+
# security context, in which case these values will take precedence.
76+
securityContext:
77+
# coder.securityContext.runAsNonRoot -- Requires that the coder container
78+
# runs as an unprivileged user. If setting runAsUser to 0 (root), this
79+
# will need to be set to false.
80+
runAsNonRoot: true
81+
# coder.securityContext.runAsUser -- Sets the user id of the pod.
82+
# For security reasons, we recommend using a non-root user.
83+
runAsUser: 1000
84+
# coder.securityContext.runAsGroup -- Sets the group id of the pod.
85+
# For security reasons, we recommend using a non-root group.
86+
runAsGroup: 1000
87+
# coder.securityContext.readOnlyRootFilesystem -- Mounts the container's
88+
# root filesystem as read-only. It is recommended to leave this setting
89+
# enabled in production. This will override the same setting in the pod
90+
readOnlyRootFilesystem: true
91+
# coder.securityContext.seccompProfile -- Sets the seccomp profile for
92+
# the coder container.
93+
seccompProfile:
94+
type: RuntimeDefault
95+
# coder.securityContext.allowPrivilegeEscalation -- Controls whether
96+
# the container can gain additional privileges, such as escalating to
97+
# root. It is recommended to leave this setting disabled in production.
98+
allowPrivilegeEscalation: false
99+
53100
# coder.env -- The environment variables to set for Coder. These can be used
54101
# to configure all aspects of `coder server`. Please see `coder server --help`
55102
# for information about what environment variables can be set.

0 commit comments

Comments
 (0)