Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 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.1

#### Non-Breaking Changes

- Added support for [nekomeowww/factorio-rcon-api](https://github.com/nekomeowww/factorio-rcon-api) including corresponding fields for values.yaml

### V2.1.0

#### 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.1.0
version: 2.1.1

# 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
34 changes: 32 additions & 2 deletions charts/factorio-server-charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ spec:
mountPath: /factorio
- name: {{ template "factorio-server-charts.fullname" . }}-save-importer-configmap
mountPath: /scripts
{{- end }}
{{- end }}
containers:
- name: {{ template "factorio-server-charts.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
Expand All @@ -143,7 +143,7 @@ spec:
- name: factorio
containerPort: {{ .Values.factorioServer.port }}
protocol: UDP
- containerPort: 27015
- containerPort: {{ .Values.factorioServer.rcon_port }}
protocol: TCP
resources:
{{ toYaml .Values.resources | indent 10 }}
Expand Down Expand Up @@ -173,6 +173,8 @@ spec:
value: /factorio/configs
- name: PORT
value: {{ .Values.factorioServer.port | quote }}
- name: RCON_PORT
value: {{ .Values.factorioServer.rcon_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 }}"
Expand Down Expand Up @@ -206,6 +208,34 @@ spec:
- pingpong3.factorio.com
- pingpong4.factorio.com
{{- end }}
{{- if .Values.rcon_api.enabled }}
- name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
image: "{{ .Values.rcon_api.image.repository }}:{{ .Values.rcon_api.image.tag }}"
imagePullPolicy: {{ .Values.rcon_api.image.pullPolicy }}
livenessProbe:
httpGet:
path: /healthz
port: rcon-api
- name: rcon-api
containerPort: 24180
protocol: TCP
- containerPort: 24181
protocol: TCP
env:
- name: FACTORIO_RCON_HOST
value: "localhost"
- name: FACTORIO_RCON_PORT
value: {{ .Values.factorioServer.rcon_port | quote }}
- name: FACTORIO_RCON_PASSWORD
{{- if .Values.rcon.passwordSecret }}
valueFrom:
secretKeyRef:
name: {{ .Values.rcon.passwordSecret }}
key: rconpw
{{- else }}
value: {{ .Values.rcon.password | quote }}
{{- end }}
{{- end }}
{{- if .Values.nodeSelector }}
nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
Expand Down
41 changes: 41 additions & 0 deletions charts/factorio-server-charts/templates/rcon-api-ingress.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{{- if and .Values.rcon_api.enabled .Values.rcon_api.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
annotations:
{{- range $key, $value := .Values.rcon_api.ingress.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
labels:
app: {{ template "factorio-server-charts.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
ingressClassName: {{ .Values.rcon_api.ingress.className }}
rules:
- host: {{ .Values.rcon_api.ingress.hostname }}
http:
paths:
- backend:
service:
name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
port:
number: {{ .Values.rcon_api.httpPort }}
path: /
pathType: Prefix
- backend:
service:
name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
port:
number: {{ .Values.rcon_api.grpcPort }}
path: /grpc
pathType: Prefix
{{- if and .Values.rcon_api.ingress.tls.enabled .Values.rcon_api.ingress.tls.secretName }}
tls:
- hosts:
- {{ .Values.rcon_api.ingress.hostname }}
secretName: {{ .Values.rcon_api.ingress.tls.secretName }}
{{- end }}
{{- end }}
34 changes: 34 additions & 0 deletions charts/factorio-server-charts/templates/rcon-api-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{{- if .Values.rcon_api.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "factorio-server-charts.fullname" . }}-rcon-api
labels:
app: {{ template "factorio-server-charts.fullname" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
annotations:
{{- range $key, $value := .Values.rcon_api.serviceAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
type: {{ .Values.rcon_api.type }}
ports:
- name: http
port: {{ .Values.rcon_api.httpPort }}
targetPort: 24180
{{- if eq .Values.rcon_api.type "NodePort" }}
nodePort: {{ .Values.rcon_api.httpPort }}
{{- end }}
protocol: TCP
- name: grpc
port: {{ .Values.rcon_api.grpcPort }}
targetPort: 24181
{{- if eq .Values.rcon_api.type "NodePort" }}
nodePort: {{ .Values.rcon_api.grpcPort }}
{{- end }}
protocol: TCP
selector:
app: {{ template "factorio-server-charts.fullname" . }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ spec:
ports:
- name: rcon
port: {{ .Values.rcon.port }}
targetPort: 27015
targetPort: {{ .Values.factorioServer.rcon_port }}
{{- if eq .Values.rcon.type "NodePort" }}
nodePort: {{ .Values.rcon.port}}
{{- end }}
Expand Down
45 changes: 43 additions & 2 deletions charts/factorio-server-charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ mods:
## @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
## @param factorioServer.rcon_port Factorio Server RCON port
factorioServer:
# name to use for the save file
save_name: "replaceMe"
Expand All @@ -165,6 +166,10 @@ factorioServer:
# 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
# factorio game rcon port
# 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 rcon server port where you connect to it, update the "rcon.port" value accordingly.
rcon_port: 27015

import_save:
# enable save importer
Expand Down Expand Up @@ -322,15 +327,15 @@ port_fixer:
## @param rcon.external Enable RCON external access (deploy RCON service)
## @param rcon.type RCON service type
## @param rcon.serviceAnnotations RCON service annotations
## @param rcon.passwordSecret Existing secret containing a `password` data field
## @param rcon.passwordSecret Existing secret containing a `rconpw` data field
## @param rcon.password Password for RCON, ignored if `rcon.passwordSecret` is set
## @param rcon.port RCON service external port
# Password and port for the rcon service
rcon:
external: true
type: LoadBalancer
serviceAnnotations: {}
# Existing secret containing a `password` data field
# Existing secret containing a `rconpw` data field
passwordSecret: ""

# Password for rcon
Expand All @@ -339,6 +344,42 @@ rcon:
# rcon port
port: 30100

## @param rcon_api.enabled Enable or disable the RCON API service
## @param rcon_api.image.repository RCON-API image repository
## @param rcon_api.image.tag RCON-API image tag (immutable tags are recommended)
## @param rcon_api.image.pullPolicy RCON-API image pull policy
## @param rcon_api.type Kubernetes service type for the RCON API (e.g., ClusterIP, NodePort, LoadBalancer)
## @param rcon_api.serviceAnnotations Annotations to add to the RCON API service
## @param rcon_api.httpPort Internal port on which the HTTP API for RCON is exposed
## @param rcon_api.grpcPort Internal port on which the gRPC API for RCON is exposed
## @param rcon_api.ingress.enabled Enable or disable the Ingress for the RCON API service
## @param rcon_api.ingress.hostname Hostname for the RCON API Ingress
## @param rcon_api.ingress.className Ingress class name for selecting the Ingress controller (e.g., nginx, cilium)
## @param rcon_api.ingress.annotations Additional annotations for the Ingress resource
## @param rcon_api.ingress.tls.enabled Enable or disable TLS for the Ingress
## @param rcon_api.ingress.tls.secretName Kubernetes Secret name for TLS certificates used by the Ingress
rcon_api:
enabled: false
image:
repository: "ghcr.io/nekomeowww/factorio-rcon-api"
pullPolicy: Always
tag: latest
type: ClusterIP
serviceAnnotations: {}
httpPort: 30110
grpcPort: 30111

ingress:
enabled: true
hostname: "factorio.example.com"
className: "nginx"
annotations:
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/backend-protocol: "GRPC"
tls:
enabled: false
secretName: "cert-factorio.example.com"

## @param map_gen_settings.width Map width in tiles; 0 means infinite
## @param map_gen_settings.height Map height in tiles; 0 means infinite
## @param map_gen_settings.starting_area Multiplier for biter free zone radius
Expand Down
Loading