Skip to content

Commit b3b164d

Browse files
committed
splitting security context
1 parent 5b32315 commit b3b164d

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

charts/factorio-server-charts/templates/deployment.yaml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ metadata:
99
heritage: "{{ .Release.Service }}"
1010
spec:
1111
replicas: 1
12+
{{- with .Values.securityContext }}
13+
securityContext:
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
1216
selector:
1317
matchLabels:
1418
app: {{ template "factorio-server-charts.fullname" . }}
@@ -55,8 +59,8 @@ spec:
5559
#sleep 100
5660
chmod -vR 777 /factorio/configs
5761
ls -alth /factorio
58-
{{- with .Values.securityContext }}
59-
securityContext:
62+
{{- with .Values.podSecurityContext }}
63+
podSecurityContext:
6064
{{- toYaml . | nindent 12 }}
6165
{{- end }}
6266
volumeMounts:
@@ -86,8 +90,8 @@ spec:
8690
- |
8791
mkdir -p /factorio/mods
8892
bash /scripts/mod-downloader.sh
89-
{{- with .Values.securityContext }}
90-
securityContext:
93+
{{- with .Values.podSecurityContext }}
94+
podSecurityContext:
9195
{{- toYaml . | nindent 12 }}
9296
{{- end }}
9397
volumeMounts:
@@ -109,8 +113,8 @@ spec:
109113
- -ec
110114
- |
111115
bash /scripts/save-importer.sh
112-
{{- with .Values.securityContext }}
113-
securityContext:
116+
{{- with .Values.podSecurityContext }}
117+
podSecurityContext:
114118
{{- toYaml . | nindent 12 }}
115119
{{- end }}
116120
volumeMounts:
@@ -123,8 +127,8 @@ spec:
123127
- name: {{ template "factorio-server-charts.fullname" . }}
124128
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
125129
imagePullPolicy: {{ .Values.image.pullPolicy }}
126-
{{- with .Values.securityContext }}
127-
securityContext:
130+
{{- with .Values.podSecurityContext }}
131+
podSecurityContext:
128132
{{- toYaml . | nindent 10 }}
129133
{{- end }}
130134
livenessProbe:
@@ -209,8 +213,8 @@ spec:
209213
- name: {{ template "factorio-server-charts.fullname" . }}-port-fixer
210214
image: "{{ .Values.port_fixer.image.repository }}:{{ .Values.port_fixer.image.tag }}"
211215
imagePullPolicy: {{ .Values.port_fixer.image.pullPolicy }}
212-
{{- with .Values.securityContext }}
213-
securityContext:
216+
{{- with .Values.podSecurityContext }}
217+
podSecurityContext:
214218
{{- toYaml . | nindent 10 }}
215219
{{- end }}
216220
command: ["/factorio-port-fixer"]

charts/factorio-server-charts/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@ hostNetworkEnabled: true
1616

1717
# https://github.com/factoriotools/factorio-docker/blob/master/docker/Dockerfile
1818
securityContext:
19+
fsGroup: 845
20+
21+
podSecurityContext:
1922
runAsUser: 845
2023
runAsGroup: 845
21-
fsGroup: 845
2224

2325
#### Image Configuration ####
2426
## @section Image Parameters

0 commit comments

Comments
 (0)