Skip to content

Commit 4186f10

Browse files
committed
Update mornedhels/enshrouded-server to v1.2.0
- Remove gamePort, as Enshrouded only uses queryPort now - Add support for setting hooks in values file - Add experimental role support - Update readme to reflect new password options
1 parent 27a2d62 commit 4186f10

File tree

8 files changed

+67
-38
lines changed

8 files changed

+67
-38
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ helm install enshrouded-server enshrouded-k8s/enshrouded-k8s \
1616
--set gameServer.password=changeme
1717
```
1818

19-
As Enshrouded seems to rely on the query port being enabled to find and connect to servers, the server is configured with the query port exposed by default.
20-
2119
The chart will generate a server password, which can be retrieved with
2220

2321
```bash
@@ -26,6 +24,9 @@ kubectl get secrets <secrets-name> -o json | jq '.data | map_values(@base64d)'
2624

2725
Alternatively, the password can be supplied in the `values` file or by specifying existing secrets. The secret must have a `server-password` key.
2826

27+
> [!TIP]
28+
> Passwords for roles can be provided in the same secret as `<role-name>-password`.
29+
2930
By default, the chart will provision a PVC using the default StorageClass. You can also provide an existing PVC, or change the StorageClass.
3031

3132
# Configuration

chart/enshrouded-k8s/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ apiVersion: v2
33
description: A basic chart to deploy Enshrouded dedicated servers.
44
name: enshrouded-k8s
55
type: application
6-
version: 0.4.0
7-
appVersion: "1.1.0"
6+
version: 0.5.0
7+
appVersion: "1.2.0"
88
kubeVersion: ">=1.26.0-0"
99
sources:
1010
- https://github.com/bdelwood/enshrouded-k8s

chart/enshrouded-k8s/README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# enshrouded-k8s
22

3-
![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.1.0](https://img.shields.io/badge/AppVersion-1.1.0-informational?style=flat-square)
3+
![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.2.0](https://img.shields.io/badge/AppVersion-1.2.0-informational?style=flat-square)
44

55
A basic chart to deploy Enshrouded dedicated servers.
66

@@ -22,22 +22,25 @@ Kubernetes: `>=1.26.0-0`
2222
| gameServer.backup.cron_expression | string | `"*/15 * * * *"` | Cron expression for backup scheduling. Defines when the backups should be triggered. The default value schedules a backup every 15 minutes. Use standard cron format. |
2323
| gameServer.backup.directory | string | `"./backup"` | Directory for backups. Supports relative and absolute paths. |
2424
| gameServer.backup.max_count | int | `0` | Number of backups to keep. When set to 0, never delete backups |
25-
| gameServer.community.enabled | bool | `true` | Enable if you want your server to show up as a community server. Exposes the Steam query port. |
26-
| gameServer.community.service.nodePort | int | `nil` | Node port a community server (for NodePort service type). Defaults to Node port for game server + 1 |
27-
| gameServer.community.service.port | int | `nil` | Service port for a community server. Defaults to the server port + 1 |
2825
| gameServer.existingSecret | string | `""` | Name of an existing secret for the server password. |
2926
| gameServer.gameBranch | string | `"public"` | Which Steam branch to use for the game server. |
3027
| gameServer.logDir | string | `"./logs"` | Directory for logs sets logDirectory in game server config |
3128
| gameServer.password | string | `""` | Server password If one is not provided or an existing secret it not provided, one will be generated. |
3229
| gameServer.players | int | `16` | Number of players allowed on the server concurrently. |
30+
| gameServer.roles | list | `[]` | A list of roles for the game server. Each role includes a name, an optional password, a list of permissions, and the number of reserved slots. If the password is empty or missing, one will be generated. The role passwords can be provided with an existing secret via `existingSecret`, where the key must have the format `<role-name>-password`. See the [official docs](https://enshrouded.zendesk.com/hc/en-us/articles/19191581489309-Server-Roles-Configuration) for more details on roles. |
3331
| gameServer.saveDir | string | `"./savegame"` | Directory for game saves sets saveDirectory in game server config |
3432
| gameServer.serverIP | string | `"0.0.0.0"` | Server IP used Enshrouded server settings |
3533
| gameServer.serverName | string | `""` | Custom server name. |
3634
| gameServer.service.nodePort | int | `nil` | Node port for the game server (for NodePort service type). |
37-
| gameServer.service.port | int | `15636` | Service port for the game server. |
35+
| gameServer.service.port | int | `15637` | Service port for the game server. |
3836
| gameServer.steamcmdArgs | string | `"validate"` | Extra arguments to pass to steamcmd when updating. |
3937
| gameServer.update.check_players | bool | `false` | Check if players are connected before updating. |
4038
| gameServer.update.cron_expression | string | `"*/30 * * * *"` | Cron expression for updates. Defines when the update check should run. The default value checks for updates every half hour. Use standard cron format. |
39+
| hooks.backup.post | string | `""` | Command to run after backup & cleanup |
40+
| hooks.backup.pre | string | `""` | Command to run before backup & cleanup |
41+
| hooks.bootstrap | string | `""` | Command to run after general bootstrap |
42+
| hooks.update.post | string | `""` | Command to run after update |
43+
| hooks.update.pre | string | `""` | Command to run before update |
4144
| image.pullPolicy | string | `"IfNotPresent"` | Image pull policy |
4245
| image.registry | string | `"docker.io"` | Container registry for the image. |
4346
| image.repository | string | `"mornedhels/enshrouded-server"` | Image repository |

chart/enshrouded-k8s/templates/configmap.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,18 @@ data:
1919
BACKUP_MAX_COUNT: "{{ .Values.gameServer.backup.max_count }}"
2020
GAME_BRANCH: "{{ .Values.gameServer.gameBranch }}"
2121
STEAMCMD_ARGS: "{{ .Values.gameServer.steamcmdArgs }}"
22+
{{- range $index, $role := .Values.gameServer.roles }}
23+
SERVER_ROLE_{{ $index }}_NAME: "{{ $role.name }}"
24+
SERVER_ROLE_{{ $index }}_RESERVED_SLOTS: "{{ $role.reserved_slots }}"
25+
{{- range $permission := $role.permissions }}
26+
SERVER_ROLE_{{ $index }}_CAN_{{ upper $permission }}: true
27+
{{- end }}
28+
{{- end }}
29+
BOOTSTRAP_HOOK: "{{ .Values.hooks.bootstrap }}"
30+
UPDATE_PRE_HOOK: "{{ .Values.hooks.update.pre }}"
31+
UPDATE_POST_HOOK: "{{ .Values.hooks.update.post }}"
32+
BACKUP_PRE_HOOK: "{{ .Values.hooks.backup.pre }}"
33+
BACKUP_POST_HOOK: "{{ .Values.hooks.backup.post }}"
2234
{{- range $key, $value := .Values.extraEnv }}
2335
{{ $key }}: "{{ $value }}"
2436
{{- end }}

chart/enshrouded-k8s/templates/deployment.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,14 @@ spec:
5454
secretKeyRef:
5555
name: {{ default (include "enshrouded-k8s.fullname" .) .Values.gameServer.existingSecret | quote }}
5656
key: server-password
57+
{{- range $index, $role := $.Values.gameServer.roles }}
58+
- name: SERVER_ROLE_{{ $index }}_PASSWORD
59+
valueFrom:
60+
secretKeyRef:
61+
name: {{ default (include "enshrouded-k8s.fullname" $) $.Values.gameServer.existingSecret | quote }}
62+
key: {{ $role.name }}-password
63+
{{- end }}
5764
ports:
58-
- name: gameserver
59-
containerPort: 15636
60-
protocol: UDP
6165
- name: queryport
6266
containerPort: 15637
6367
protocol: UDP

chart/enshrouded-k8s/templates/secrets.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,7 @@ metadata:
99
type: Opaque
1010
data:
1111
server-password: {{ default (randAlphaNum 12) .Values.gameServer.password | b64enc | quote }}
12+
{{- range $index, $role := .Values.gameServer.roles }}
13+
{{ $role.name }}-password: {{ default (randAlphaNum 12) $role.password | b64enc | quote }}
14+
{{- end }}
1215
{{- end }}

chart/enshrouded-k8s/templates/service.yaml

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,12 @@ metadata:
88
spec:
99
type: {{ .Values.service.type }}
1010
ports:
11-
- name: gameserver
12-
port: {{ .Values.gameServer.service.port | int }}
13-
protocol: UDP
14-
targetPort: gameserver
15-
{{- if eq .Values.service.type "NodePort" }}
16-
nodePort: {{ default "" .Values.gameServer.service.nodePort | int }}
17-
{{- end }}
18-
{{- if .Values.gameServer.community.enabled }}
1911
- name: queryport
20-
port: {{ default (add .Values.gameServer.service.port 1) .Values.gameServer.community.service.port | int }}
12+
port: {{ .Values.gameServer.service.port | int }}
2113
protocol: UDP
2214
targetPort: queryport
2315
{{- if eq .Values.service.type "NodePort" }}
24-
{{- $defaultNodePort := add (.Values.gameServer.service.nodePort | int) 1 }}
25-
nodePort: {{ default $defaultNodePort .Values.gameServer.community.service.nodePort | int }}
16+
nodePort: {{ default "" .Values.gameServer.service.nodePort | int }}
2617
{{- end }}
27-
{{- end }}
2818
selector:
2919
{{- include "enshrouded-k8s.selectorLabels" . | nindent 4 }}

chart/enshrouded-k8s/values.yaml

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,9 @@ gameServer:
4040
password: ""
4141
service:
4242
# -- Service port for the game server.
43-
port: 15636
43+
port: 15637
4444
# -- (int) Node port for the game server (for NodePort service type).
4545
nodePort:
46-
community:
47-
# -- Enable if you want your server to show up as a community server.
48-
# Exposes the Steam query port.
49-
enabled: true
50-
service:
51-
# -- (int) Service port for a community server.
52-
# Defaults to the server port + 1
53-
port:
54-
# -- (int) Node port a community server (for NodePort service type).
55-
# Defaults to Node port for game server + 1
56-
nodePort:
5746
# -- Server IP used Enshrouded server settings
5847
serverIP: "0.0.0.0"
5948

@@ -87,8 +76,35 @@ gameServer:
8776
gameBranch: "public"
8877
# -- Extra arguments to pass to steamcmd when updating.
8978
steamcmdArgs: "validate"
90-
91-
79+
# -- A list of roles for the game server.
80+
# Each role includes a name, an optional password, a list of permissions, and the number of reserved slots. If the password is empty or missing, one will be generated. The role passwords can be provided with an existing secret via `existingSecret`, where the key must have the format `<role-name>-password`.
81+
# See the [official docs](https://enshrouded.zendesk.com/hc/en-us/articles/19191581489309-Server-Roles-Configuration) for more details on roles.
82+
roles: []
83+
# - name: "default" # The name of the role.
84+
# password: "" # (Optional) The password for the role.
85+
# permissions: # A list of permissions granted to this role.
86+
# - "kick_ban" # Allows the role to kick and ban players.
87+
# - "access_inventories" # Allows the role to access player inventories.
88+
# - "edit_base" # Allows the role to edit the base.
89+
# - "extend_base" # Allows the role to extend the base.
90+
# reserved_slots: 16 # The number of slots reserved for this role.
91+
# - name: "guests" # A role with no permissions
92+
# reserved_slots: 1
93+
94+
95+
hooks:
96+
# -- Command to run after general bootstrap
97+
bootstrap: ""
98+
update:
99+
# -- Command to run before update
100+
pre: ""
101+
# -- Command to run after update
102+
post: ""
103+
backup:
104+
# -- Command to run before backup & cleanup
105+
pre: ""
106+
# -- Command to run after backup & cleanup
107+
post: ""
92108

93109
# -- Define extra environment variables to pass directly to the container.
94110
# Any env vars which are set by other values will be overridden.

0 commit comments

Comments
 (0)