Skip to content

Feature/allow server id.json #13

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
Jan 13, 2022
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
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ The following table lists the configurable parameters of the `factorio-server-ch
| factorioServer.generate_new_save | Generate a New Save | `true` |
| factorioServer.update_mods_on_start | Update mods on start | `false` |
| factorioServer.load_latest_save | lets the game know if you want to load the latest save | `true` |
| factorioServer.config_path | Location of the configuration files that are generated | `/srv` |
| serverSettings.name | Your Instance Name | `Factorio` |
| serverSettings.description | Your Instance Description | `"Factorio running on Kubernetes"` |
| serverSettings.max_players | Maximum number of players allowed, admins can join even a full server. 0 means unlimited. | `0` |
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: 1.0.9
version: 1.0.10

# 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
1 change: 0 additions & 1 deletion charts/factorio-server-charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ The following table lists the configurable parameters of the `factorio-server-ch
| factorioServer.generate_new_save | Generate a New Save | `true` |
| factorioServer.update_mods_on_start | Update mods on start | `false` |
| factorioServer.load_latest_save | lets the game know if you want to load the latest save | `true` |
| factorioServer.config_path | Location of the configuration files that are generated | `/srv` |
| serverSettings.name | Your Instance Name | `Factorio` |
| serverSettings.description | Your Instance Description | `"Factorio running on Kubernetes"` |
| serverSettings.max_players | Maximum number of players allowed, admins can join even a full server. 0 means unlimited. | `0` |
Expand Down
31 changes: 23 additions & 8 deletions charts/factorio-server-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,34 @@ spec:
labels:
app: {{ template "factorio-server-charts.fullname" . }}
spec:
securityContext:
runAsUser: 845
runAsGroup: 845
fsGroup: 845
initContainers:
- name: volume-permissions-serversettingsconfig
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- /bin/bash
- -ec
- |
mkdir -p /factorio/configs
mkdir -p /factorio/config
cp --verbose /deployed-configs/* /factorio/configs
#sleep 100
chown -vR factorio:factorio /factorio
chmod -vR 777 /factorio/configs
ls -alth /factorio
securityContext:
runAsUser: 0
volumeMounts:
- name: datadir
mountPath: /factorio
- name: {{ template "factorio-server-charts.fullname" . }}-serversettingsconfig
mountPath: /deployed-configs
containers:
- name: {{ template "factorio-server-charts.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
securityContext:
runAsUser: 0
allowPrivilegeEscalation: true
ports:
- name: factorio
containerPort: {{ .Values.service.port }}
Expand All @@ -41,8 +58,6 @@ spec:
volumeMounts:
- name: datadir
mountPath: /factorio
- name: {{ template "factorio-server-charts.fullname" . }}-serversettingsconfig
mountPath: {{ .Values.factorioServer.config_path | quote }}
env:
- name: UPDATE_MODS_ON_START
value: {{ .Values.factorioServer.update_mods_on_start | quote }}
Expand All @@ -59,7 +74,7 @@ spec:
- name: PORT
value: {{ .Values.service.port | quote }}
- name: CONFIG
value: {{ .Values.factorioServer.config_path | quote }}
value: /factorio/configs
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
13 changes: 4 additions & 9 deletions charts/factorio-server-charts/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

#### K8s configuration ####

## Number of replicas to create (only 1 is supported)
replicaCount: 1

Expand All @@ -13,18 +12,15 @@ image:
## You should set an fix version, i.e.:
# tag: "1.1.37"

# Security options the operator container should run with
securityContext:
runAsUser: 1000
fsGroup: 2000


## The service is a kind tricky, so factorio uses UDP, but not every cloud provider is able to route UDP traffic.
## I.e. your cloud provider has LoadBalancers without the ability for UPD protocoll. Furthermore kubectl ist not able to route UDP Traffic
## ref: https://github.com/kubernetes/kubernetes/issues/47862
## You have to expose factorio on a NodePort and map a port between 30000 and 32767, but the nativ port ist 34197. So you have always to specify the port in factorio.
## The best way ist to define a ClusterIP service and define one or more externalIPs. Of course this IPs must be avaiable on the node the factorio runs the pod!
service:
type: ClusterIP
type: LoadBalancer
port: 34197
## If you are able in your cluster to map an external IP, set it here
# externalIPs:
Expand Down Expand Up @@ -81,7 +77,7 @@ affinity: {}
## Sets the data persistence volume configuration
## IMPORTANT: If you do not setup a PV all your savegames will be lost on pod recreation or helm upgrade
persistence:
enabled: false
enabled: true
dataDir:
Size: "1Gi"
## If you have an existing claim, set your name here
Expand All @@ -104,8 +100,7 @@ factorioServer:
update_mods_on_start: false
# lets the game know if you want to load the latest save
load_latest_save: true
# Location of the configuration files that are generated
config_path: /srv


server_settings:
# Your Instance Name
Expand Down