Skip to content

Factorio port fixer #58

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

Merged
merged 2 commits into from
Nov 3, 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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Changelog

### V2.1.0

#### Non-Breaking Changes

- Added support for [ZCube/factorio-port-fixer](https://github.com/ZCube/factorio-port-fixer) including corresponding fields for values.yaml

### V2.0.4

#### Non-Breaking Changes
Expand Down
2 changes: 1 addition & 1 deletion charts/factorio-server-charts/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ sources:
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 2.0.4
version: 2.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
37 changes: 36 additions & 1 deletion charts/factorio-server-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ spec:
failureThreshold: 3
ports:
- name: factorio
containerPort: 34197
containerPort: {{ .Values.factorioServer.port }}
protocol: UDP
- containerPort: 27015
protocol: TCP
Expand Down Expand Up @@ -171,6 +171,41 @@ spec:
value: {{ .Values.factorioServer.enable_space_age | quote }}
- name: CONFIG
value: /factorio/configs
- name: PORT
value: {{ .Values.factorioServer.port | quote }}
{{- if .Values.port_fixer.enabled }}
- name: {{ template "factorio-server-charts.fullname" . }}-port-fixer
image: "{{ .Values.port_fixer.image.repository }}:{{ .Values.port_fixer.image.tag }}"
imagePullPolicy: {{ .Values.port_fixer.image.pullPolicy }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
command: ["/factorio-port-fixer"]
args:
- local
- --ip=127.0.0.1
- --port=34197
- --remotePort={{ .Values.port_fixer.port | default .Values.service.port }}
livenessProbe:
httpGet:
path: /health
port: port-fixer
periodSeconds: 10
initialDelaySeconds: 5
failureThreshold: 3
ports:
- name: port-fixer
containerPort: 34197
protocol: TCP
hostAliases:
- ip: "127.0.0.1"
hostnames:
- pingpong1.factorio.com
- pingpong2.factorio.com
- pingpong3.factorio.com
- pingpong4.factorio.com
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/factorio-server-charts/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
{{- end }}
ports:
- name: factorio
targetPort: 34197
targetPort: {{ .Values.factorioServer.port }}
port: {{ .Values.service.port }}
protocol: UDP
{{- if eq .Values.service.type "NodePort" }}
Expand Down
29 changes: 29 additions & 0 deletions charts/factorio-server-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ mods:
## @param factorioServer.generate_new_save Generate a new save if `save_name` is not found
## @param factorioServer.update_mods_on_start Update mods on server start
## @param factorioServer.load_latest_save Lets the game know if you want to load the latest save
## @param factorioServer.port Factorio Game Server port
factorioServer:
# name to use for the save file
save_name: "replaceMe"
Expand All @@ -159,6 +160,11 @@ factorioServer:
load_latest_save: true
# enables or disables the mods for DLC Space Age in mod-list.json
enable_space_age: true
# factorio game server port
# the default game port (34197) has been changed to 31497 to resolve issues when using the port-fixer.
# this port setting is typically for internal Kubernetes configuration only, and in most cases, it does not need to be modified.
# if it is necessary to change the game server port where you connect to the game, update the "service.port" value accordingly.
port: 31497

import_save:
# enable save importer
Expand Down Expand Up @@ -290,6 +296,29 @@ server_settings:
maximum_segment_size: 100
maximum_segment_size_peer_count: 10

## @section Port-Fixer Parameters
## @param port_fixer.enabled Enable the Factorio Port Fixer
## @param image.repository Factorio port-fixer image repository
## @param image.tag Factorio port fixer image tag (immutable tags are recommended)
## @param image.pullPolicy Factorio port fixer image pull policy
## @param image.port Factorio port to announce via port-fixer, defaults to service.port
port_fixer:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be portFixer?

# Adds an extra container that tries to help with connection issues via the public server browser.
# This is especially useful when you can’t set up outgoing static port mappings and see log messages like these:
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:19296}), expected IP ADDR:({<ip>:58037}))
# > Warning ServerMultiplayerManager.cpp:651: Determining own address has failed. Best guess: IP ADDR:({<ip>:58037})
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:19297}), expected IP ADDR:({<ip>:58037}))
# > Warning ServerRouter.cpp:541: Received own address message reply with conflicting address (got IP ADDR:({<ip>:24105}), expected IP ADDR:({<ip>:58037}))
# Note: Port forwarding for incoming traffic still needs to be set up properly for this to work.
# For more info, check out:
# - https://github.com/SQLJames/factorio-server-charts/issues/15
enabled: false
image:
repository: "ghcr.io/zcube/factorio-port-fixer"
pullPolicy: Always
tag: latest
port: ''

## @param rcon.external Enable RCON external access (deploy RCON service)
## @param rcon.type RCON service type
## @param rcon.serviceAnnotations RCON service annotations
Expand Down
Loading