Skip to content

Commit faf6032

Browse files
committed
Merge remote-tracking branch 'origin' into bug/modencoding
2 parents 7674546 + 78cf1bd commit faf6032

File tree

7 files changed

+164
-44
lines changed

7 files changed

+164
-44
lines changed

CHANGELOG.md

+38-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,48 @@
11
## Changelog
22

3-
### V2.2.1
3+
### V2.4.1
44

55
#### Non-Breaking Changes
6-
76
- Fixing mod download script to encode spaces properly, fixes [Issue 42](https://github.com/SQLJames/factorio-server-charts/issues/42)
87
- Adding update mod check on mod script to avoid it always updating mods, fixes part of[Issue 45](https://github.com/SQLJames/factorio-server-charts/issues/45)
98

9+
### V2.4.0
10+
11+
#### Potentially Breaking Changes
12+
13+
- Removing the chown of the data directory initialization and instead switching the security context to use the factorio user specified in [factorio docker](https://github.com/factoriotools/factorio-docker/blob/master/docker/Dockerfile). This will fix the nfs permissions but could potentially cause issues elsewhere if you were setting the security context.
14+
15+
### V2.3.0
16+
17+
#### Non-Breaking Changes
18+
19+
- Decoupling hostNetworking from the nodePort service. Introduces hostNetworkEnabled in the base of the values. By default this will still enabled with a standard set of values, but can be individually disabled if needed. [Issue 38](https://github.com/SQLJames/factorio-server-charts/issues/38)
20+
21+
### V2.2.4
22+
23+
#### Non-Breaking Changes
24+
25+
- Adding the option to append ENV variables to the factorio server container, fixes [Issue 66](https://github.com/SQLJames/factorio-server-charts/issues/66) and [Issue 37](https://github.com/SQLJames/factorio-server-charts/issues/37)
26+
27+
### V2.2.3
28+
29+
#### Non-Breaking Changes
30+
31+
- Adding support for ipFamilyPolicy, fixing [Issue 63](https://github.com/SQLJames/factorio-server-charts/issues/63)
32+
33+
### V2.2.2
34+
35+
#### Non-Breaking Changes
36+
37+
- Disabled port-fixer livenessProbe due to reliability issues
38+
39+
### V2.2.1
40+
41+
#### Non-Breaking Changes
42+
43+
- Correct issues in deployment when `rconAPI` and `port_fixer` are used simultaniously.
44+
- Add missing `ports` key to rconAPI container
45+
1046
### V2.2.0
1147

1248
#### Non-Breaking Changes

charts/factorio-server-charts/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ sources:
2020
# This is the chart version. This version number should be incremented each time you make changes
2121
# to the chart and its templates, including the app version.
2222
# Versions are expected to follow Semantic Versioning (https://semver.org/)
23-
version: 2.2.1
23+
version: 2.4.1
2424

2525
# This is the version number of the application being deployed. This version number should be
2626
# incremented each time you make changes to the application. Versions are not expected to

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

+49-40
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@ spec:
1919
labels:
2020
app: {{ template "factorio-server-charts.fullname" . }}
2121
spec:
22+
{{- with .Values.securityContext }}
23+
securityContext:
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
2226
dnsConfig:
2327
options:
2428
- name: ndots
2529
value: '1'
26-
{{- if eq .Values.service.type "NodePort" }}
30+
{{- if .Values.hostNetworkEnabled }}
2731
hostNetwork: true
28-
{{- else }}
29-
hostNetwork: false
3032
{{- end }}
3133
initContainers:
3234
- name: volume-permissions-serversettingsconfig
@@ -55,10 +57,9 @@ spec:
5557
jq -M --rawfile game_password /gamePassword/game_password '.game_password=($game_password|gsub("[\\n\\t]"; ""))' /factorio/configs/server-settings.json > /tmp/server-settings.json && mv /tmp/server-settings.json /factorio/configs/server-settings.json
5658
fi
5759
#sleep 100
58-
chown -vR factorio:factorio /factorio
5960
chmod -vR 777 /factorio/configs
6061
ls -alth /factorio
61-
{{- with .Values.securityContext }}
62+
{{- with .Values.podSecurityContext }}
6263
securityContext:
6364
{{- toYaml . | nindent 12 }}
6465
{{- end }}
@@ -93,7 +94,7 @@ spec:
9394
bash /scripts/mod-downloader.sh
9495
echo "Finished mod-downloader.sh script"
9596
ls -althR /factorio/mods
96-
{{- with .Values.securityContext }}
97+
{{- with .Values.podSecurityContext }}
9798
securityContext:
9899
{{- toYaml . | nindent 12 }}
99100
{{- end }}
@@ -119,7 +120,7 @@ spec:
119120
- -ec
120121
- |
121122
bash /scripts/save-importer.sh
122-
{{- with .Values.securityContext }}
123+
{{- with .Values.podSecurityContext }}
123124
securityContext:
124125
{{- toYaml . | nindent 12 }}
125126
{{- end }}
@@ -133,7 +134,7 @@ spec:
133134
- name: {{ template "factorio-server-charts.fullname" . }}
134135
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
135136
imagePullPolicy: {{ .Values.image.pullPolicy }}
136-
{{- with .Values.securityContext }}
137+
{{- with .Values.podSecurityContext }}
137138
securityContext:
138139
{{- toYaml . | nindent 10 }}
139140
{{- end }}
@@ -182,39 +183,10 @@ spec:
182183
value: {{ .Values.factorioServer.port | quote }}
183184
- name: RCON_PORT
184185
value: {{ .Values.factorioServer.rcon_port | quote }}
185-
{{- if .Values.port_fixer.enabled }}
186-
- name: {{ template "factorio-server-charts.fullname" . }}-port-fixer
187-
image: "{{ .Values.port_fixer.image.repository }}:{{ .Values.port_fixer.image.tag }}"
188-
imagePullPolicy: {{ .Values.port_fixer.image.pullPolicy }}
189-
{{- with .Values.securityContext }}
190-
securityContext:
191-
{{- toYaml . | nindent 10 }}
186+
{{- range .Values.factorioServer.env }}
187+
- name: {{ .name }}
188+
value: {{ .value | quote }}
192189
{{- end }}
193-
command: ["/factorio-port-fixer"]
194-
args:
195-
- local
196-
- --ip=127.0.0.1
197-
- --port=34197
198-
- --remotePort={{ .Values.port_fixer.port | default .Values.service.port }}
199-
livenessProbe:
200-
httpGet:
201-
path: /health
202-
port: port-fixer
203-
periodSeconds: 10
204-
initialDelaySeconds: 5
205-
failureThreshold: 3
206-
ports:
207-
- name: port-fixer
208-
containerPort: 34197
209-
protocol: TCP
210-
hostAliases:
211-
- ip: "127.0.0.1"
212-
hostnames:
213-
- pingpong1.factorio.com
214-
- pingpong2.factorio.com
215-
- pingpong3.factorio.com
216-
- pingpong4.factorio.com
217-
{{- end }}
218190
{{- if .Values.rconAPI.enabled }}
219191
- name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
220192
image: "{{ .Values.rconAPI.image.repository }}:{{ .Values.rconAPI.image.tag }}"
@@ -223,6 +195,7 @@ spec:
223195
httpGet:
224196
path: /healthz
225197
port: rcon-api
198+
ports:
226199
- name: rcon-api
227200
containerPort: 24180
228201
protocol: TCP
@@ -243,6 +216,42 @@ spec:
243216
value: {{ .Values.rcon.password | quote }}
244217
{{- end }}
245218
{{- end }}
219+
{{- if .Values.port_fixer.enabled }}
220+
- name: {{ template "factorio-server-charts.fullname" . }}-port-fixer
221+
image: "{{ .Values.port_fixer.image.repository }}:{{ .Values.port_fixer.image.tag }}"
222+
imagePullPolicy: {{ .Values.port_fixer.image.pullPolicy }}
223+
{{- with .Values.podSecurityContext }}
224+
securityContext:
225+
{{- toYaml . | nindent 10 }}
226+
{{- end }}
227+
command: ["/factorio-port-fixer"]
228+
args:
229+
- local
230+
- --ip=127.0.0.1
231+
- --port=34197
232+
- --remotePort={{ .Values.port_fixer.port | default .Values.service.port }}
233+
#
234+
# Disabled due to reliability issues: https://github.com/ZCube/factorio-port-fixer/issues/1
235+
#
236+
# livenessProbe:
237+
# httpGet:
238+
# path: /health
239+
# port: port-fixer
240+
# periodSeconds: 10
241+
# initialDelaySeconds: 5
242+
# failureThreshold: 3
243+
ports:
244+
- name: port-fixer
245+
containerPort: 34197
246+
protocol: TCP
247+
hostAliases:
248+
- ip: "127.0.0.1"
249+
hostnames:
250+
- pingpong1.factorio.com
251+
- pingpong2.factorio.com
252+
- pingpong3.factorio.com
253+
- pingpong4.factorio.com
254+
{{- end }}
246255
{{- if .Values.nodeSelector }}
247256
nodeSelector:
248257
{{ toYaml .Values.nodeSelector | indent 8 }}

charts/factorio-server-charts/templates/rcon-api-service.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ metadata:
1313
{{ $key }}: {{ $value | quote }}
1414
{{- end }}
1515
spec:
16+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
17+
{{- if .Values.rconAPI.ipFamilyPolicy }}
18+
ipFamilyPolicy: {{ .Values.rconAPI.ipFamilyPolicy }}
19+
{{- end }}
20+
{{- end }}
21+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
22+
{{- if .Values.rconAPI.ipFamilies }}
23+
ipFamilies: {{ toYaml .Values.rconAPI.ipFamilies | nindent 4 }}
24+
{{- end }}
25+
{{- end }}
1626
type: {{ .Values.rconAPI.type }}
1727
ports:
1828
- name: http

charts/factorio-server-charts/templates/rcon-service.yaml

+10
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ metadata:
1313
{{ $key }}: {{ $value | quote }}
1414
{{- end }}
1515
spec:
16+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
17+
{{- if .Values.rcon.ipFamilyPolicy }}
18+
ipFamilyPolicy: {{ .Values.rcon.ipFamilyPolicy }}
19+
{{- end }}
20+
{{- end }}
21+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
22+
{{- if .Values.rcon.ipFamilies }}
23+
ipFamilies: {{ toYaml .Values.rcon.ipFamilies | nindent 4 }}
24+
{{- end }}
25+
{{- end }}
1626
type: {{ .Values.rcon.type }}
1727
ports:
1828
- name: rcon

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

+10
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ metadata:
1414
{{- end }}
1515
{{- end }}
1616
spec:
17+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
18+
{{- if .Values.service.ipFamilyPolicy }}
19+
ipFamilyPolicy: {{ .Values.service.ipFamilyPolicy }}
20+
{{- end }}
21+
{{- end }}
22+
{{- if semverCompare ">=1.20.0-0" .Capabilities.KubeVersion.Version -}}
23+
{{- if .Values.service.ipFamilies }}
24+
ipFamilies: {{ toYaml .Values.service.ipFamilies | nindent 4 }}
25+
{{- end }}
26+
{{- end }}
1727
type: {{ .Values.service.type }}
1828
{{- if .Values.service.externalTrafficPolicy}}
1929
externalTrafficPolicy: {{ .Values.service.externalTrafficPolicy }}

charts/factorio-server-charts/values.yaml

+46-1
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,15 @@
1212

1313
replicaCount: 1
1414

15+
hostNetworkEnabled: true
16+
17+
# https://github.com/factoriotools/factorio-docker/blob/master/docker/Dockerfile
1518
securityContext:
16-
runAsUser: 0
19+
fsGroup: 845
20+
21+
podSecurityContext:
22+
runAsUser: 845
23+
runAsGroup: 845
1724

1825
#### Image Configuration ####
1926
## @section Image Parameters
@@ -48,6 +55,17 @@ nodeSelector: {}
4855
## The best way ist to define a ClusterIP service and define one or more externalIPs. Of course this IPs must be available on the node the factorio pod runs on!
4956
service:
5057
type: NodePort
58+
## Represents the dual-stack-ness requested or required by this Service. Possible values are
59+
## SingleStack, PreferDualStack or RequireDualStack.
60+
## The ipFamilies and clusterIPs fields depend on the value of this field.
61+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
62+
ipFamilyPolicy: "SingleStack"
63+
64+
## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically
65+
## based on cluster configuration and the ipFamilyPolicy field.
66+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
67+
ipFamilies:
68+
- IPv4
5169
port: 31497
5270
## If you are able to map an external IP, set it here
5371
# externalIPs:
@@ -150,6 +168,7 @@ mods:
150168
## @param factorioServer.load_latest_save Lets the game know if you want to load the latest save
151169
## @param factorioServer.port Factorio Game Server port
152170
## @param factorioServer.rcon_port Factorio Server RCON port
171+
## @param factorioServer.env Additional environment values for the Factorio Server container
153172
factorioServer:
154173
# name to use for the save file
155174
save_name: "replaceMe"
@@ -170,6 +189,10 @@ factorioServer:
170189
# this port setting is typically for internal Kubernetes configuration only, and in most cases, it does not need to be modified.
171190
# if it is necessary to change the rcon server port where you connect to it, update the "rcon.port" value accordingly.
172191
rcon_port: 27015
192+
# adding addtional environment variables to the factorio server container
193+
env: {}
194+
# - name: MY_VAR
195+
# value: "my_value"
173196

174197
import_save:
175198
# enable save importer
@@ -332,6 +355,17 @@ port_fixer:
332355
## @param rcon.port RCON service external port
333356
# Password and port for the rcon service
334357
rcon:
358+
## Represents the dual-stack-ness requested or required by this Service. Possible values are
359+
## SingleStack, PreferDualStack or RequireDualStack.
360+
## The ipFamilies and clusterIPs fields depend on the value of this field.
361+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
362+
ipFamilyPolicy: "SingleStack"
363+
364+
## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically
365+
## based on cluster configuration and the ipFamilyPolicy field.
366+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
367+
ipFamilies:
368+
- IPv4
335369
external: true
336370
type: LoadBalancer
337371
serviceAnnotations: {}
@@ -359,6 +393,17 @@ rcon:
359393
## @param rconAPI.ingress.tls.enabled Enable or disable TLS for the Ingress
360394
## @param rconAPI.ingress.tls.secretName Kubernetes Secret name for TLS certificates used by the Ingress
361395
rconAPI:
396+
## Represents the dual-stack-ness requested or required by this Service. Possible values are
397+
## SingleStack, PreferDualStack or RequireDualStack.
398+
## The ipFamilies and clusterIPs fields depend on the value of this field.
399+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
400+
ipFamilyPolicy: "SingleStack"
401+
402+
## List of IP families (e.g. IPv4, IPv6) assigned to the service. This field is usually assigned automatically
403+
## based on cluster configuration and the ipFamilyPolicy field.
404+
## Ref: https://kubernetes.io/docs/concepts/services-networking/dual-stack/
405+
ipFamilies:
406+
- IPv4
362407
enabled: false
363408
image:
364409
repository: "ghcr.io/nekomeowww/factorio-rcon-api"

0 commit comments

Comments
 (0)