fix(valheim): Correctly map ports when changed in the UI (#1921)

* fix(valheim): Correctly map ports when changed in the UI

* remove `-` from service name

* don't use tpl for targetPort

* tpl on `port`

* no tpl on port either

* remove targetPort and document reason
This commit is contained in:
Stavros Kois
2022-02-21 19:41:47 +01:00
committed by GitHub
parent b04c6f2cc2
commit f7264a994c
4 changed files with 19 additions and 25 deletions
+1 -1
View File
@@ -18,7 +18,7 @@ name: valheim
sources: sources:
- https://github.com/lloesche/valheim-server-docker - https://github.com/lloesche/valheim-server-docker
- https://hub.docker.com/r/lloesche/valheim-server - https://hub.docker.com/r/lloesche/valheim-server
version: 2.0.23 version: 2.0.24
annotations: annotations:
truecharts.org/catagories: | truecharts.org/catagories: |
- media - media
+3 -3
View File
@@ -297,7 +297,7 @@ questions:
type: dict type: dict
attrs: attrs:
# Include{serviceSelector} # Include{serviceSelector}
- variable: valheim-1 - variable: valheim1
label: "valheim-1 Service Port Configuration" label: "valheim-1 Service Port Configuration"
schema: schema:
additional_attrs: true additional_attrs: true
@@ -345,7 +345,7 @@ questions:
type: int type: int
default: 2456 default: 2456
- variable: valheim-2 - variable: valheim2
label: "valheim-2 Service Port Configuration" label: "valheim-2 Service Port Configuration"
schema: schema:
additional_attrs: true additional_attrs: true
@@ -393,7 +393,7 @@ questions:
type: int type: int
default: 2457 default: 2457
- variable: valheim-3 - variable: valheim3
label: "valheim-3 Service Port Configuration" label: "valheim-3 Service Port Configuration"
schema: schema:
additional_attrs: true additional_attrs: true
+7 -21
View File
@@ -1,26 +1,21 @@
image: image:
# -- image repository
repository: tccr.io/truecharts/valheim-server repository: tccr.io/truecharts/valheim-server
# -- image tag
tag: latest@sha256:8f87fda54429923cac3601d581d6dc0ff273ef6438374e9f4b1e5ac1141b461d tag: latest@sha256:8f87fda54429923cac3601d581d6dc0ff273ef6438374e9f4b1e5ac1141b461d
# -- image pull policy
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
secret: secret:
SUPERVISOR_HTTP_USER: admin SUPERVISOR_HTTP_USER: admin
SUPERVISOR_HTTP_PASS: secret SUPERVISOR_HTTP_PASS: secret
SERVER_PASS: secret SERVER_PASS: secret
# -- environment variables. See [image docs](https://github.com/lloesche/valheim-server-docker#environment-variables) for more details.
# @default -- See below
env: env:
# -- Set the container timezone
TZ: UTC TZ: UTC
STATUS_HTTP: true STATUS_HTTP: true
STATUS_HTTP_PORT: 9010 STATUS_HTTP_PORT: "{{ .Values.service.main.ports.main.port }}"
SUPERVISOR_HTTP_PORT: 9011 SUPERVISOR_HTTP_PORT: "{{ .Values.service.supervisor.ports.supervisor.port }}"
SUPERVISOR_HTTP: true SUPERVISOR_HTTP: true
SERVER_NAME: My Server SERVER_NAME: My Server
SERVER_PORT: 2456 SERVER_PORT: "{{ .Values.service.valheim.ports.valheim1.port }}"
WORLD_NAME: Dedicated WORLD_NAME: Dedicated
SERVER_PUBLIC: true SERVER_PUBLIC: true
UPDATE_INTERVAL: 10800 UPDATE_INTERVAL: 10800
@@ -37,43 +32,34 @@ podSecurityContext:
runAsUser: 0 runAsUser: 0
runAsGroup: 0 runAsGroup: 0
# -- Configures service settings for the chart.
# @default -- See values.yaml
service: service:
main: main:
ports: ports:
main: main:
port: 9010 port: 9010
targetPort: 9010
supervisor: supervisor:
enabled: true enabled: true
ports: ports:
supervisor: supervisor:
enabled: true enabled: true
port: 9011 port: 9011
targetPort: 9011
valheim: valheim:
enabled: true enabled: true
type: LoadBalancer type: LoadBalancer
ports: ports:
valheim-1: valheim1:
enabled: true enabled: true
port: 2456 port: 2456
targetPort: 2456
protocol: UDP protocol: UDP
valheim-2: valheim2:
enabled: true enabled: true
port: 2457 port: 2457
targetPort: 2457
protocol: UDP protocol: UDP
valheim-3: valheim3:
enabled: true enabled: true
port: 2458 port: 2458
protocol: UDP protocol: UDP
targetPort: 2458
# -- Configure persistence settings for the chart under this key.
# @default -- See values.yaml
persistence: persistence:
config: config:
enabled: true enabled: true
+8
View File
@@ -0,0 +1,8 @@
# Installation Notes
Valheim app does not support having different port numbers for `port` and `targetPort`.
Setting `port` will set the same port number to `targetPort` and it's Environmental Variable.
e.g `STATUS_HTTP_PORT`, `SUPERVISOR_HTTP_PORT`, `SERVER_PORT`
Also, services named `valheim1`, `valheim2`, `valheim3`, should be continuous port numbers. eg 2456, 2457, 2458.
You can't skip a number!