From 0e28d7ce93ae6b7773e9a6dcd999af4f383def89 Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:32:46 +0100 Subject: [PATCH 1/9] add rcon-rest-api container --- CHANGELOG.md | 6 +++ charts/factorio-server-charts/Chart.yaml | 2 +- .../templates/deployment.yaml | 40 +++++++++++++++++- .../templates/rcon-api-ingress.yaml | 41 +++++++++++++++++++ .../templates/rcon-api-service.yaml | 34 +++++++++++++++ charts/factorio-server-charts/values.yaml | 36 ++++++++++++++++ 6 files changed, 157 insertions(+), 2 deletions(-) create mode 100644 charts/factorio-server-charts/templates/rcon-api-ingress.yaml create mode 100644 charts/factorio-server-charts/templates/rcon-api-service.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index eb7a253..e70d562 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ ## Changelog +### V2.0.3 + +#### Non-Breaking Changes + +- Added support for [nekomeowww/factorio-rcon-api](https://github.com/nekomeowww/factorio-rcon-api) including corresponding fields for values.yaml + ### V2.0.2 #### Non-Breaking Changes diff --git a/charts/factorio-server-charts/Chart.yaml b/charts/factorio-server-charts/Chart.yaml index 5905d9e..5a4e149 100644 --- a/charts/factorio-server-charts/Chart.yaml +++ b/charts/factorio-server-charts/Chart.yaml @@ -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.2 +version: 2.0.3 # 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 diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index 23ded48..f27de64 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -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 }}" @@ -171,6 +171,44 @@ spec: value: {{ .Values.factorioServer.enable_space_age | quote }} - name: CONFIG value: /factorio/configs +{{- 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.image.pullPolicy }} + {{- with .Values.securityContext }} + securityContext: + {{- toYaml . | nindent 10 }} + {{- end }} + livenessProbe: + exec: + command: + - sh + - -c + - curl -s localhost:24180/api/v1/factorio/console/command/version | grep -q -E '{"version":".*"}' + periodSeconds: 10 + initialDelaySeconds: 5 + failureThreshold: 3 + ports: + - name: rcon-api + containerPort: 24180 + protocol: TCP + - containerPort: 24181 + protocol: TCP + env: + - name: FACTORIO_RCON_HOST + value: "localhost" + - name: FACTORIO_RCON_PORT + value: "27015" + - 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 }} diff --git a/charts/factorio-server-charts/templates/rcon-api-ingress.yaml b/charts/factorio-server-charts/templates/rcon-api-ingress.yaml new file mode 100644 index 0000000..3a7af15 --- /dev/null +++ b/charts/factorio-server-charts/templates/rcon-api-ingress.yaml @@ -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 }} diff --git a/charts/factorio-server-charts/templates/rcon-api-service.yaml b/charts/factorio-server-charts/templates/rcon-api-service.yaml new file mode 100644 index 0000000..78d14da --- /dev/null +++ b/charts/factorio-server-charts/templates/rcon-api-service.yaml @@ -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 }} diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index bffa9ed..2d2e643 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -307,6 +307,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: true + 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 From 007fb5e58d73a060ffb05848f8997d19e85f6bd4 Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:36:26 +0100 Subject: [PATCH 2/9] fix rcon-api imagePullPolicy --- charts/factorio-server-charts/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index f27de64..28a2597 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -174,7 +174,7 @@ spec: {{- 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.image.pullPolicy }} + imagePullPolicy: {{ .Values.rcon_api.image.pullPolicy }} {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 10 }} From b6b3d910c3d65e5a9e5fbaa1f79223144270b106 Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Thu, 31 Oct 2024 19:34:47 +0100 Subject: [PATCH 3/9] add healthz livenessProbe --- charts/factorio-server-charts/templates/deployment.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index 28a2597..cc0a4df 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -180,11 +180,9 @@ spec: {{- toYaml . | nindent 10 }} {{- end }} livenessProbe: - exec: - command: - - sh - - -c - - curl -s localhost:24180/api/v1/factorio/console/command/version | grep -q -E '{"version":".*"}' + httpGet: + path: /healthz + port: rcon-api periodSeconds: 10 initialDelaySeconds: 5 failureThreshold: 3 From d79d012f5835d7c913ce89f95c7d9f9f46ecaa5d Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:13:39 +0100 Subject: [PATCH 4/9] make rcon_port configurable, update valuse --- charts/factorio-server-charts/templates/deployment.yaml | 6 ++++-- .../factorio-server-charts/templates/rcon-service.yaml | 2 +- charts/factorio-server-charts/values.yaml | 9 +++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index cc0a4df..17dedee 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -143,7 +143,7 @@ spec: - name: factorio containerPort: 34197 protocol: UDP - - containerPort: 27015 + - containerPort: {{ .Values.factorioServer.rcon_port | quote }} protocol: TCP resources: {{ toYaml .Values.resources | indent 10 }} @@ -171,6 +171,8 @@ spec: value: {{ .Values.factorioServer.enable_space_age | quote }} - name: CONFIG value: /factorio/configs + - name: RCON_PORT + value: {{ .Values.factorioServer.rcon_port | quote }} {{- if .Values.rcon_api.enabled }} - name: {{ template "factorio-server-charts.fullname" . }}-rcon-api image: "{{ .Values.rcon_api.image.repository }}:{{ .Values.rcon_api.image.tag }}" @@ -196,7 +198,7 @@ spec: - name: FACTORIO_RCON_HOST value: "localhost" - name: FACTORIO_RCON_PORT - value: "27015" + value: {{ .Values.factorioServer.rcon_port | quote }} - name: FACTORIO_RCON_PASSWORD {{- if .Values.rcon.passwordSecret }} valueFrom: diff --git a/charts/factorio-server-charts/templates/rcon-service.yaml b/charts/factorio-server-charts/templates/rcon-service.yaml index 248e184..71b2183 100644 --- a/charts/factorio-server-charts/templates/rcon-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-service.yaml @@ -17,7 +17,7 @@ spec: ports: - name: rcon port: {{ .Values.rcon.port }} - targetPort: 27015 + targetPort: {{ .Values.factorioServer.rcon_port | quote }} {{- if eq .Values.rcon.type "NodePort" }} nodePort: {{ .Values.rcon.port}} {{- end }} diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index 2d2e643..21ae593 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -145,6 +145,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.rcon_port Factorio Server RCON port factorioServer: # name to use for the save file save_name: "replaceMe" @@ -156,6 +157,10 @@ factorioServer: load_latest_save: true # enables or disables the mods for DLC Space Age in mod-list.json enable_space_age: true + # 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 @@ -290,7 +295,7 @@ server_settings: ## @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 @@ -298,7 +303,7 @@ rcon: external: true type: LoadBalancer serviceAnnotations: {} - # Existing secret containing a `password` data field + # Existing secret containing a `rconpw` data field passwordSecret: "" # Password for rcon From a7a05cd0f1583abae91d4cb9073a03fbb7e5b4f5 Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:30:45 +0100 Subject: [PATCH 5/9] dont quote containerPort --- charts/factorio-server-charts/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index 17dedee..ebd89a2 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -143,7 +143,7 @@ spec: - name: factorio containerPort: 34197 protocol: UDP - - containerPort: {{ .Values.factorioServer.rcon_port | quote }} + - containerPort: {{ .Values.factorioServer.rcon_port }} protocol: TCP resources: {{ toYaml .Values.resources | indent 10 }} From deaac1fbb4c21ef203930812a4ad650dabdb5840 Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:36:47 +0100 Subject: [PATCH 6/9] dont quote targetPort --- charts/factorio-server-charts/templates/rcon-service.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/factorio-server-charts/templates/rcon-service.yaml b/charts/factorio-server-charts/templates/rcon-service.yaml index 71b2183..74ff326 100644 --- a/charts/factorio-server-charts/templates/rcon-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-service.yaml @@ -17,7 +17,7 @@ spec: ports: - name: rcon port: {{ .Values.rcon.port }} - targetPort: {{ .Values.factorioServer.rcon_port | quote }} + targetPort: {{ .Values.factorioServer.rcon_port }} {{- if eq .Values.rcon.type "NodePort" }} nodePort: {{ .Values.rcon.port}} {{- end }} From d9c522bd4d8098d46c911a629f431329071893c3 Mon Sep 17 00:00:00 2001 From: Timo Jaspers <67470612+Kariton@users.noreply.github.com> Date: Sun, 3 Nov 2024 10:44:07 +0100 Subject: [PATCH 7/9] fix EOF --- charts/factorio-server-charts/templates/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index c45486b..59a5e28 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -207,6 +207,7 @@ spec: - pingpong2.factorio.com - 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 }}" From 11609c86567ec204c8acba668342c84f1769a648 Mon Sep 17 00:00:00 2001 From: Timo Jaspers <67470612+Kariton@users.noreply.github.com> Date: Sun, 3 Nov 2024 13:35:07 +0100 Subject: [PATCH 8/9] disabled tls per default --- charts/factorio-server-charts/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index 12d8157..805a160 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -377,7 +377,7 @@ rcon_api: nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/backend-protocol: "GRPC" tls: - enabled: true + enabled: false secretName: "cert-factorio.example.com" ## @param map_gen_settings.width Map width in tiles; 0 means infinite From 2a07975cf1f15b03499af3237407710b504a368f Mon Sep 17 00:00:00 2001 From: Kariton <67470612+Kariton@users.noreply.github.com> Date: Sun, 3 Nov 2024 14:53:29 +0100 Subject: [PATCH 9/9] change version; rename rcon_api to rconAPI --- CHANGELOG.md | 2 +- charts/factorio-server-charts/Chart.yaml | 2 +- .../templates/deployment.yaml | 6 ++-- .../templates/rcon-api-ingress.yaml | 18 +++++------ .../templates/rcon-api-service.yaml | 18 +++++------ charts/factorio-server-charts/values.yaml | 30 +++++++++---------- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 859ce65..5dbc24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## Changelog -### V2.1.1 +### V2.2.0 #### Non-Breaking Changes diff --git a/charts/factorio-server-charts/Chart.yaml b/charts/factorio-server-charts/Chart.yaml index 90fa6e6..057c278 100644 --- a/charts/factorio-server-charts/Chart.yaml +++ b/charts/factorio-server-charts/Chart.yaml @@ -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.1 +version: 2.2.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 diff --git a/charts/factorio-server-charts/templates/deployment.yaml b/charts/factorio-server-charts/templates/deployment.yaml index 59a5e28..8532aa6 100644 --- a/charts/factorio-server-charts/templates/deployment.yaml +++ b/charts/factorio-server-charts/templates/deployment.yaml @@ -208,10 +208,10 @@ spec: - pingpong3.factorio.com - pingpong4.factorio.com {{- end }} -{{- if .Values.rcon_api.enabled }} +{{- if .Values.rconAPI.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 }} + image: "{{ .Values.rconAPI.image.repository }}:{{ .Values.rconAPI.image.tag }}" + imagePullPolicy: {{ .Values.rconAPI.image.pullPolicy }} livenessProbe: httpGet: path: /healthz diff --git a/charts/factorio-server-charts/templates/rcon-api-ingress.yaml b/charts/factorio-server-charts/templates/rcon-api-ingress.yaml index 3a7af15..51781bf 100644 --- a/charts/factorio-server-charts/templates/rcon-api-ingress.yaml +++ b/charts/factorio-server-charts/templates/rcon-api-ingress.yaml @@ -1,10 +1,10 @@ -{{- if and .Values.rcon_api.enabled .Values.rcon_api.ingress.enabled }} +{{- if and .Values.rconAPI.enabled .Values.rconAPI.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 }} + {{- range $key, $value := .Values.rconAPI.ingress.annotations }} {{ $key }}: {{ $value | quote }} {{- end }} labels: @@ -13,29 +13,29 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" spec: - ingressClassName: {{ .Values.rcon_api.ingress.className }} + ingressClassName: {{ .Values.rconAPI.ingress.className }} rules: - - host: {{ .Values.rcon_api.ingress.hostname }} + - host: {{ .Values.rconAPI.ingress.hostname }} http: paths: - backend: service: name: {{ template "factorio-server-charts.fullname" . }}-rcon-api port: - number: {{ .Values.rcon_api.httpPort }} + number: {{ .Values.rconAPI.httpPort }} path: / pathType: Prefix - backend: service: name: {{ template "factorio-server-charts.fullname" . }}-rcon-api port: - number: {{ .Values.rcon_api.grpcPort }} + number: {{ .Values.rconAPI.grpcPort }} path: /grpc pathType: Prefix - {{- if and .Values.rcon_api.ingress.tls.enabled .Values.rcon_api.ingress.tls.secretName }} + {{- if and .Values.rconAPI.ingress.tls.enabled .Values.rconAPI.ingress.tls.secretName }} tls: - hosts: - - {{ .Values.rcon_api.ingress.hostname }} - secretName: {{ .Values.rcon_api.ingress.tls.secretName }} + - {{ .Values.rconAPI.ingress.hostname }} + secretName: {{ .Values.rconAPI.ingress.tls.secretName }} {{- end }} {{- end }} diff --git a/charts/factorio-server-charts/templates/rcon-api-service.yaml b/charts/factorio-server-charts/templates/rcon-api-service.yaml index 78d14da..d7c4684 100644 --- a/charts/factorio-server-charts/templates/rcon-api-service.yaml +++ b/charts/factorio-server-charts/templates/rcon-api-service.yaml @@ -1,4 +1,4 @@ -{{- if .Values.rcon_api.enabled }} +{{- if .Values.rconAPI.enabled }} apiVersion: v1 kind: Service metadata: @@ -9,24 +9,24 @@ metadata: release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" annotations: - {{- range $key, $value := .Values.rcon_api.serviceAnnotations }} + {{- range $key, $value := .Values.rconAPI.serviceAnnotations }} {{ $key }}: {{ $value | quote }} {{- end }} spec: - type: {{ .Values.rcon_api.type }} + type: {{ .Values.rconAPI.type }} ports: - name: http - port: {{ .Values.rcon_api.httpPort }} + port: {{ .Values.rconAPI.httpPort }} targetPort: 24180 - {{- if eq .Values.rcon_api.type "NodePort" }} - nodePort: {{ .Values.rcon_api.httpPort }} + {{- if eq .Values.rconAPI.type "NodePort" }} + nodePort: {{ .Values.rconAPI.httpPort }} {{- end }} protocol: TCP - name: grpc - port: {{ .Values.rcon_api.grpcPort }} + port: {{ .Values.rconAPI.grpcPort }} targetPort: 24181 - {{- if eq .Values.rcon_api.type "NodePort" }} - nodePort: {{ .Values.rcon_api.grpcPort }} + {{- if eq .Values.rconAPI.type "NodePort" }} + nodePort: {{ .Values.rconAPI.grpcPort }} {{- end }} protocol: TCP selector: diff --git a/charts/factorio-server-charts/values.yaml b/charts/factorio-server-charts/values.yaml index 805a160..6df23a6 100644 --- a/charts/factorio-server-charts/values.yaml +++ b/charts/factorio-server-charts/values.yaml @@ -344,21 +344,21 @@ 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: +## @param rconAPI.enabled Enable or disable the RCON API service +## @param rconAPI.image.repository RCON-API image repository +## @param rconAPI.image.tag RCON-API image tag (immutable tags are recommended) +## @param rconAPI.image.pullPolicy RCON-API image pull policy +## @param rconAPI.type Kubernetes service type for the RCON API (e.g., ClusterIP, NodePort, LoadBalancer) +## @param rconAPI.serviceAnnotations Annotations to add to the RCON API service +## @param rconAPI.httpPort Internal port on which the HTTP API for RCON is exposed +## @param rconAPI.grpcPort Internal port on which the gRPC API for RCON is exposed +## @param rconAPI.ingress.enabled Enable or disable the Ingress for the RCON API service +## @param rconAPI.ingress.hostname Hostname for the RCON API Ingress +## @param rconAPI.ingress.className Ingress class name for selecting the Ingress controller (e.g., nginx, cilium) +## @param rconAPI.ingress.annotations Additional annotations for the Ingress resource +## @param rconAPI.ingress.tls.enabled Enable or disable TLS for the Ingress +## @param rconAPI.ingress.tls.secretName Kubernetes Secret name for TLS certificates used by the Ingress +rconAPI: enabled: false image: repository: "ghcr.io/nekomeowww/factorio-rcon-api"