fix(ark): Replace params with better UI/UX (#5278)

* Remove targetport, update questions

Remove targetport so that value is set to the prrovided value for port.
Update questions with info to change the port numbers for multiple servers.

* some changes

* typo

* Update charts/incubator/arksurvivalevolved/Chart.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* Update charts/incubator/arksurvivalevolved/values.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* fixe

* Update charts/incubator/arksurvivalevolved/Chart.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* bump

* add error message when port is not +1

* Update charts/incubator/arksurvivalevolved/templates/common.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

* fix secretname

* fix name

* Easier params

* add another check

* Fix typo

Fixed typo in label for UDP Steam Service

Signed-off-by: Whiskey24 <bert@santema.eu>

* bump common

* Update charts/incubator/arksurvivalevolved/templates/common.yaml

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>

Signed-off-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
Signed-off-by: Whiskey24 <bert@santema.eu>
Co-authored-by: Stavros Kois <47820033+stavros-k@users.noreply.github.com>
This commit is contained in:
Whiskey24
2022-12-22 01:05:19 +02:00
committed by GitHub
co-authored by Stavros Kois
parent 84bdd4a60a
commit ceb3930d6d
5 changed files with 171 additions and 99 deletions
@@ -26,4 +26,4 @@ sources:
- https://survivetheark.com/ - https://survivetheark.com/
- https://hub.docker.com/r/ich777/steamcmd/ - https://hub.docker.com/r/ich777/steamcmd/
type: application type: application
version: 2.0.4 version: 3.0.0
@@ -8,88 +8,102 @@ questions:
# Include{replicas} # Include{replicas}
# Include{replica1} # Include{replica1}
# Include{controllerExpertExtraArgs} # Include{controllerExpertExtraArgs}
- variable: secretEnv - variable: ark
group: "App Configuration" group: App Configuration
label: "Image Secrets" label: Ark Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: USERNAME - variable: username
label: "USERNAME" label: Username
description: "Your Steam username goes here if you want to install a game that needs a valid account, otherwise leave it blank (ATTENTION You have to disable Steam Guard)." description: Your Steam username goes here if you want to install a game that needs a valid account, otherwise leave it blank (ATTENTION You have to disable Steam Guard).
schema: schema:
type: string type: string
default: "" default: ""
- variable: PASSWRD - variable: password
label: "PASSWRD" label: Password
description: "Your Steam password goes here if you want to install a game that needs a valid account, otherwise leave it blank (ATTENTION You have to disable Steam Guard)." description: Your Steam password goes here if you want to install a game that needs a valid account, otherwise leave it blank (ATTENTION You have to disable Steam Guard).
schema: schema:
type: string type: string
private: true private: true
default: "" default: ""
- variable: SRV_PWD - variable: srv_password
label: "SRV_PWD" label: Server Password
description: "Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)" description: Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)
schema: schema:
type: string type: string
private: true private: true
default: "" default: ""
- variable: SRV_ADMIN_PWD - variable: srv_admin_pass
label: "SRV_ADMIN_PWD" label: Server Admin Password
description: "Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)" description: Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)
schema: schema:
type: string type: string
private: true private: true
default: "" default: ""
- variable: env - variable: game_id
group: "App Configuration" label: Game ID
label: "Image Environment"
schema:
additional_attrs: true
type: dict
attrs:
- variable: GAME_ID
label: "GAME_ID"
description: "The GAME_ID that the container download at startup.(https://developer.valvesoftware.com/wiki/Dedicated_Servers_List)" description: "The GAME_ID that the container download at startup.(https://developer.valvesoftware.com/wiki/Dedicated_Servers_List)"
schema: schema:
type: string type: string
default: "376030" default: "376030"
- variable: MAP - variable: map
label: "MAP" label: Map
description: "Map name" description: Map Name
schema: schema:
type: string type: string
default: "TheIsland" default: TheIsland
- variable: SERVER_NAME - variable: server_name
label: "SERVER_NAME" label: Server Name
description: "Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)" description: Leave empty if you want to use the settings from GameUserSettings.ini (this field accepts no spaces)
schema: schema:
type: string type: string
default: "" default: ""
- variable: VALIDATE - variable: validate
label: "VALIDATE" label: Valitdate
description: "Set the Variable to true if you want to validate the installation otherwise leave it blank." description: "Set the Variable to true if you want to validate the installation otherwise leave it blank."
schema: schema:
type: boolean type: boolean
default: true default: true
- variable: GAME_PARAMS - variable: rcon_enabled
label: "GAME_PARAMS" label: Enable RCON
description: "Enter your game parameters separated with ? and start with ? (don't put spaces in between eg: ?MaxPlayers=40?FastDecayUnsnappedCoreStructures=true)"
schema: schema:
type: string type: boolean
default: "?RCONPort=27020?RCONEnabled=True" default: true
- variable: GAME_PARAMS_EXTRA - variable: game_params
label: "GAME_PARAMS_EXTRA" label: Game Parameters
description: "Values to start the server" description: "Enter your game parameters starting with ? (don't put spaces in between eg: ?MaxPlayers=40?FastDecayUnsnappedCoreStructures=true). For multiple servers, change the port numbers in Networking and Services section ONLY."
schema: schema:
type: string type: list
default: "-server -log -crossplay" default: []
items:
- variable: game_params_entry
label: Parameter Entry
description: Single parameter per entry. Start with ?
schema:
type: string
default: ""
required: true
- variable: game_params_extra
label: Game Extra Parameters
description: "Values to start the server, one per entry"
schema:
type: list
default: ["-server", "-log", "-crossplay"]
items:
- variable: game_params_extra_entry
label: Extra Parameter Entry
description: Single parameter per entry.
schema:
type: string
default: ""
required: true
# Include{containerConfig} # Include{containerConfig}
# Include{serviceRoot} # Include{serviceRoot}
- variable: main - variable: main
label: "Main Service" label: Main Service
description: "The Primary service on which the healthcheck runs, often the webUI" description: The Primary service on which the healthcheck runs, often the webUI
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -97,21 +111,21 @@ questions:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: main - variable: main
label: "Main Service Port Configuration" label: Main Service Port Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: "Port" label: Port
description: "This port exposes the container port on the service" description: This port exposes the container port on the service
schema: schema:
type: int type: int
default: 7777 default: 7777
required: true required: true
- variable: udp2 - variable: udp2
label: "udp2 service" label: udp2 service
description: "Container Port 7778" description: This should always be (Main Port + 1)
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -119,21 +133,21 @@ questions:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: udp2 - variable: udp2
label: "udp2 Service Port Configuration" label: udp2 Service Port Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: "Port" label: Port
description: "This port exposes the container port on the service" description: This port exposes the container port on the service
schema: schema:
type: int type: int
default: 7778 default: 7778
required: true required: true
- variable: udpsteam - variable: udpsteam
label: "udpsteam service" label: UDP Steam Service
description: "Container Port 27015" description: Container Port 27015
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -141,21 +155,21 @@ questions:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: udpsteam - variable: udpsteam
label: "udpsteam Service Port Configuration" label: UDP Steam Service Port Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: "Port" label: Port
description: "This port exposes the container port on the service" description: This port exposes the container port on the service
schema: schema:
type: int type: int
default: 27015 default: 27015
required: true required: true
- variable: rcontcp - variable: rcontcp
label: "rcontcp service" label: rcontcp service
description: "Container Port 27020" description: Container Port 27020
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -163,14 +177,14 @@ questions:
# Include{serviceSelectorLoadBalancer} # Include{serviceSelectorLoadBalancer}
# Include{serviceSelectorExtras} # Include{serviceSelectorExtras}
- variable: rcontcp - variable: rcontcp
label: "rcontcp Service Port Configuration" label: rcontcp Service Port Configuration
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
- variable: port - variable: port
label: "Port" label: Port
description: "This port exposes the container port on the service" description: This port exposes the container port on the service
schema: schema:
type: int type: int
default: 27020 default: 27020
@@ -181,16 +195,16 @@ questions:
# Include{serviceList} # Include{serviceList}
# Include{persistenceRoot} # Include{persistenceRoot}
- variable: steamcmd - variable: steamcmd
label: "steamcmd Storage" label: steamcmd Storage
description: "Container Path serverdatasteamcmd" description: Container Path serverdatasteamcmd
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
attrs: attrs:
# Include{persistenceBasic} # Include{persistenceBasic}
- variable: serverfiles - variable: serverfiles
label: "serverfiles Storage" label: serverfiles Storage
description: "Container Path serverdataserverfiles" description: Container Path serverdataserverfiles
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -199,7 +213,7 @@ questions:
# Include{persistenceList} # Include{persistenceList}
# Include{ingressRoot} # Include{ingressRoot}
- variable: main - variable: main
label: "Main Ingress" label: Main Ingress
schema: schema:
additional_attrs: true additional_attrs: true
type: dict type: dict
@@ -211,41 +225,41 @@ questions:
# Include{security} # Include{security}
# Include{securityContextAdvancedRoot} # Include{securityContextAdvancedRoot}
- variable: privileged - variable: privileged
label: "Privileged mode" label: Privileged mode
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: readOnlyRootFilesystem - variable: readOnlyRootFilesystem
label: "ReadOnly Root Filesystem" label: ReadOnly Root Filesystem
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: allowPrivilegeEscalation - variable: allowPrivilegeEscalation
label: "Allow Privilege Escalation" label: Allow Privilege Escalation
schema: schema:
type: boolean type: boolean
default: false default: false
- variable: runAsNonRoot - variable: runAsNonRoot
label: "runAsNonRoot" label: runAsNonRoot
schema: schema:
type: boolean type: boolean
default: false default: false
# Include{podSecurityContextRoot} # Include{podSecurityContextRoot}
- variable: runAsUser - variable: runAsUser
label: "runAsUser" label: runAsUser
description: "The UserID of the user running the application" description: The UserID of the user running the application
schema: schema:
type: int type: int
default: 0 default: 0
- variable: runAsGroup - variable: runAsGroup
label: "runAsGroup" label: runAsGroup
description: The groupID this App of the user running the application" description: The groupID this App of the user running the application
schema: schema:
type: int type: int
default: 0 default: 0
- variable: fsGroup - variable: fsGroup
label: "fsGroup" label: fsGroup
description: "The group that should own ALL storage." description: The group that should own ALL storage.
schema: schema:
type: int type: int
default: 568 default: 568
@@ -0,0 +1,41 @@
{{/* Define the secret */}}
{{- define "ark.secret" -}}
{{- $secretName := printf "%s-secret" (include "tc.common.names.fullname" .) }}
{{- $params := list }}
{{- $params = append $params (printf "?Port=%s" .Values.service.main.ports.main.port) -}}
{{- $params = append $params (printf "?QueryPort=%s" .Values.service.udpsteam.ports.udpsteam.port) -}}
{{- $params = append $params (printf "?RCONPort=%s" .Values.service.rcontcp.ports.rcontcp.port) -}}
{{- if .Values.ark.rcon_enabled -}}
{{- $params = append $params (print "?RCONEnabled=True") -}}
{{- end }}
---
apiVersion: v1
kind: Secret
metadata:
name: {{ $secretName }}
labels:
{{- include "tc.common.labels" . | nindent 4 }}
stringData:
GAME_ID: {{ .Values.ark.game_id | quote }}
GAME_PARAMS: {{ printf "%s%s" (join "" $params) (join "" .Values.ark.game_params) | quote }}
GAME_PARAMS_EXTRA: {{ (join " " .Values.ark.game_params_extra) | quote }}
MAP: {{ .Values.ark.map | quote }}
{{- with .Values.ark.server_name }}
SERVER_NAME: {{ . | quote }}
{{- end }}
VALIDATE: {{ default false .Values.ark.validate | quote }}
{{- with .Values.ark.srv_admin_password }}
SRV_ADMIN_PWD: {{ . | quote }}
{{- end }}
{{- with .Values.ark.srv_password }}
SRV_PWD: {{ . | quote }}
{{- end }}
{{- with .Values.ark.username }}
USERNAME: {{ . | quote }}
{{- end }}
{{- with .Values.ark.password }}
PASSWRD: {{ . | quote }}
{{- end }}
{{- end -}}
@@ -1,2 +1,16 @@
{{/* Make sure all variables are set properly */}}
{{- include "tc.common.loader.init" . }}
{{- if ne (int .Values.service.udp2.ports.udp2.port) (add1 (int .Values.service.main.ports.main.port)) -}}
{{- fail (printf "In the service udp2, the port for udp2 must be greater by 1 than the main service's port. You have to set it to <%s>." (add1 .Values.service.main.ports.main.port)) }}
{{- end -}}
{{- if and (ge (int .Values.service.udpsteam.ports.udpsteam.port) 27020) (le (int .Values.service.udpsteam.ports.udpsteam.port) 27050) -}}
{{- fail "UDP Steam Service port cannot be between 27020 and 27050." -}}
{{- end }}
{{/* Render secret */}}
{{- include "ark.secret" . }}
{{/* Render the templates */}} {{/* Render the templates */}}
{{ include "tc.common.loader.all" . }} {{ include "tc.common.loader.apply" . }}
+22 -19
View File
@@ -11,27 +11,33 @@ securityContext:
readOnlyRootFilesystem: false readOnlyRootFilesystem: false
runAsNonRoot: false runAsNonRoot: false
secretEnv: ark:
SRV_ADMIN_PWD: "" srv_admin_pass: ""
SRV_PWD: "" srv_password: ""
USERNAME: "" username: ""
PASSWRD: "" password: ""
game_id: "376030"
rcon_enabled: true
game_params: []
game_params_extra:
- -server
- -log
- -crossplay"
map: TheIsland
server_name: ""
validate: false
env: envFrom:
GAME_ID: "376030" - secretRef:
GAME_PARAMS: "?RCONPort=27020?RCONEnabled=True" name: '{{ include "tc.common.names.fullname" . }}-secret'
GAME_PARAMS_EXTRA: -server -log -crossplay
MAP: TheIsland
SERVER_NAME: ""
VALIDATE: false
probes: probes:
liveness: liveness:
port: "{{ .Values.service.rcontcp.ports.rcontcp.targetPort }}" port: "{{ .Values.service.rcontcp.ports.rcontcp.port }}"
readiness: readiness:
port: "{{ .Values.service.rcontcp.ports.rcontcp.targetPort }}" port: "{{ .Values.service.rcontcp.ports.rcontcp.port }}"
startup: startup:
port: "{{ .Values.service.rcontcp.ports.rcontcp.targetPort }}" port: "{{ .Values.service.rcontcp.ports.rcontcp.port }}"
service: service:
main: main:
@@ -39,15 +45,14 @@ service:
main: main:
port: 7777 port: 7777
protocol: UDP protocol: UDP
targetPort: 7777
udp2: udp2:
enabled: true enabled: true
ports: ports:
udp2: udp2:
enabled: true enabled: true
# This should always be main +1
port: 7778 port: 7778
protocol: UDP protocol: UDP
targetPort: 7778
udpsteam: udpsteam:
enabled: true enabled: true
ports: ports:
@@ -55,7 +60,6 @@ service:
enabled: true enabled: true
port: 27015 port: 27015
protocol: UDP protocol: UDP
targetPort: 27015
rcontcp: rcontcp:
enabled: true enabled: true
ports: ports:
@@ -63,7 +67,6 @@ service:
enabled: true enabled: true
port: 27020 port: 27020
protocol: TCP protocol: TCP
targetPort: 27020
persistence: persistence:
serverfiles: serverfiles: