Skip to content

Commit 8aea01d

Browse files
authored
Merge pull request #58 from Kariton/factorio-port-fixer
Factorio port fixer
2 parents e461f6f + 53421bc commit 8aea01d

File tree

5 files changed

+73
-3
lines changed

5 files changed

+73
-3
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
## Changelog
22

3+
### V2.1.0
4+
5+
#### Non-Breaking Changes
6+
7+
- Added support for [ZCube/factorio-port-fixer](https://github.com/ZCube/factorio-port-fixer) including corresponding fields for values.yaml
8+
39
### V2.0.4
410

511
#### Non-Breaking Changes

charts/factorio-server-charts/Chart.yaml

Lines changed: 1 addition & 1 deletion
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.0.4
23+
version: 2.1.0
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

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ spec:
141141
failureThreshold: 3
142142
ports:
143143
- name: factorio
144-
containerPort: 34197
144+
containerPort: {{ .Values.factorioServer.port }}
145145
protocol: UDP
146146
- containerPort: 27015
147147
protocol: TCP
@@ -171,6 +171,41 @@ spec:
171171
value: {{ .Values.factorioServer.enable_space_age | quote }}
172172
- name: CONFIG
173173
value: /factorio/configs
174+
- name: PORT
175+
value: {{ .Values.factorioServer.port | quote }}
176+
{{- if .Values.port_fixer.enabled }}
177+
- name: {{ template "factorio-server-charts.fullname" . }}-port-fixer
178+
image: "{{ .Values.port_fixer.image.repository }}:{{ .Values.port_fixer.image.tag }}"
179+
imagePullPolicy: {{ .Values.port_fixer.image.pullPolicy }}
180+
{{- with .Values.securityContext }}
181+
securityContext:
182+
{{- toYaml . | nindent 10 }}
183+
{{- end }}
184+
command: ["/factorio-port-fixer"]
185+
args:
186+
- local
187+
- --ip=127.0.0.1
188+
- --port=34197
189+
- --remotePort={{ .Values.port_fixer.port | default .Values.service.port }}
190+
livenessProbe:
191+
httpGet:
192+
path: /health
193+
port: port-fixer
194+
periodSeconds: 10
195+
initialDelaySeconds: 5
196+
failureThreshold: 3
197+
ports:
198+
- name: port-fixer
199+
containerPort: 34197
200+
protocol: TCP
201+
hostAliases:
202+
- ip: "127.0.0.1"
203+
hostnames:
204+
- pingpong1.factorio.com
205+
- pingpong2.factorio.com
206+
- pingpong3.factorio.com
207+
- pingpong4.factorio.com
208+
{{- end }}
174209
{{- if .Values.nodeSelector }}
175210
nodeSelector:
176211
{{ toYaml .Values.nodeSelector | indent 8 }}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ spec:
2020
{{- end }}
2121
ports:
2222
- name: factorio
23-
targetPort: 34197
23+
targetPort: {{ .Values.factorioServer.port }}
2424
port: {{ .Values.service.port }}
2525
protocol: UDP
2626
{{- if eq .Values.service.type "NodePort" }}

charts/factorio-server-charts/values.yaml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ mods:
148148
## @param factorioServer.generate_new_save Generate a new save if `save_name` is not found
149149
## @param factorioServer.update_mods_on_start Update mods on server start
150150
## @param factorioServer.load_latest_save Lets the game know if you want to load the latest save
151+
## @param factorioServer.port Factorio Game Server port
151152
factorioServer:
152153
# name to use for the save file
153154
save_name: "replaceMe"
@@ -159,6 +160,11 @@ factorioServer:
159160
load_latest_save: true
160161
# enables or disables the mods for DLC Space Age in mod-list.json
161162
enable_space_age: true
163+
# factorio game server port
164+
# the default game port (34197) has been changed to 31497 to resolve issues when using the port-fixer.
165+
# this port setting is typically for internal Kubernetes configuration only, and in most cases, it does not need to be modified.
166+
# if it is necessary to change the game server port where you connect to the game, update the "service.port" value accordingly.
167+
port: 31497
162168

163169
import_save:
164170
# enable save importer
@@ -290,6 +296,29 @@ server_settings:
290296
maximum_segment_size: 100
291297
maximum_segment_size_peer_count: 10
292298

299+
## @section Port-Fixer Parameters
300+
## @param port_fixer.enabled Enable the Factorio Port Fixer
301+
## @param image.repository Factorio port-fixer image repository
302+
## @param image.tag Factorio port fixer image tag (immutable tags are recommended)
303+
## @param image.pullPolicy Factorio port fixer image pull policy
304+
## @param image.port Factorio port to announce via port-fixer, defaults to service.port
305+
port_fixer:
306+
# Adds an extra container that tries to help with connection issues via the public server browser.
307+
# This is especially useful when you can’t set up outgoing static port mappings and see log messages like these:
308+
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:19296}), expected IP ADDR:({<ip>:58037}))
309+
# > Warning ServerMultiplayerManager.cpp:651: Determining own address has failed. Best guess: IP ADDR:({<ip>:58037})
310+
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:19297}), expected IP ADDR:({<ip>:58037}))
311+
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:24105}), expected IP ADDR:({<ip>:58037}))
312+
# Note: Port forwarding for incoming traffic still needs to be set up properly for this to work.
313+
# For more info, check out:
314+
# - https://github.com/SQLJames/factorio-server-charts/issues/15
315+
enabled: false
316+
image:
317+
repository: "ghcr.io/zcube/factorio-port-fixer"
318+
pullPolicy: Always
319+
tag: latest
320+
port: ''
321+
293322
## @param rcon.external Enable RCON external access (deploy RCON service)
294323
## @param rcon.type RCON service type
295324
## @param rcon.serviceAnnotations RCON service annotations

0 commit comments

Comments
 (0)