diff --git a/charts/incubator/eco/Chart.yaml b/charts/incubator/eco/Chart.yaml index 0d5a5328c8c..2ee1adf0cf2 100644 --- a/charts/incubator/eco/Chart.yaml +++ b/charts/incubator/eco/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "latest" dependencies: - name: common repository: https://library-charts.truecharts.org - version: 14.0.1 + version: 14.0.3 deprecated: false description: A custom SteamCMD chart that runs ECO. home: https://truecharts.org/charts/incubator/eco @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/eco - https://github.com/ich777/docker-steamcmd-server/tree/eco type: application -version: 3.0.0 +version: 3.1.0 annotations: truecharts.org/catagories: | - games diff --git a/charts/incubator/eco/questions.yaml b/charts/incubator/eco/questions.yaml index 56c9b637222..0f9f955ddf2 100644 --- a/charts/incubator/eco/questions.yaml +++ b/charts/incubator/eco/questions.yaml @@ -11,46 +11,143 @@ questions: # Include{podSpec} # Include{containerMain} - - variable: env - label: Image Environment - schema: - additional_attrs: true - type: dict - attrs: - - variable: USERNAME - label: "UserName" - description: "Your Steam username (optionally leave it blank)." - schema: - type: string - default: "" - - variable: PASSWRD - label: "Password" - description: "Your Steam password (optionally leave it blank)" - schema: - type: string - private: true - default: "" - - variable: GAME_ID - label: "Game ID" - description: "The ID of the container to download at start up." - schema: - type: string - default: "" - - variable: GAME_PARAMS - label: "Game Params" - description: "Enter your start up commands for the server." - schema: - type: string - default: "" - - variable: VALIDATE - label: "Validate" - description: "Set the Variable to true if you want to validate the installation otherwise leave it blank." - schema: - type: boolean - default: true - # Include{containerBasic} # Include{containerAdvanced} + + - variable: eco + group: App Configuration + label: Eco + schema: + additional_attrs: true + type: dict + attrs: + - variable: game + label: Game Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: id + label: Game Id + description: The ID of the container to download at start up. + schema: + type: string + required: true + default: "739590" + - variable: user + label: Steam User + description: Leave blank for anonymous login. + schema: + type: string + default: "" + - variable: password + label: Steam Password + description: Leave blank for anonymous login. + schema: + type: string + default: "" + - variable: validate + label: Validate + description: Validates the game data. + schema: + type: boolean + default: true + - variable: params + label: Game Params + schema: + type: list + default: [] + required: true + items: + - variable: param + label: Param + schema: + type: string + required: true + default: "" + - variable: network + label: Network Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: PublicServer + label: Public Server + description: Defines if other players can see server. + schema: + type: boolean + default: false + - variable: Playtime + label: Play time + schema: + type: string + default: "" + - variable: DiscordAddress + label: Discord Address + description: Invite link ID for a Discord server. + schema: + type: string + default: "" + - variable: Password + label: Password + description: Defines if a server's password. + schema: + type: string + default: "" + - variable: Description + label: Server Name + description: Defines the name of the server. + schema: + type: string + default: "Truecharts ECO Server" + - variable: DetailedDescription + label: Detailed Description + description: Defines the server's description. + schema: + type: string + default: "Vanilla ECO game" + - variable: ServerCategory + label: Server Category + description: Set the server Category. + schema: + type: string + default: "None" + enum: + - value: None + description: None + - value: Beginner + description: Beginner + - value: Established + description: Established + - value: BeginnerHard + description: BeginnerHard + - value: Strange + description: Strange + - variable: RemoteAddress + label: Remote Address + description: Public/external IP-address or domain and port number needed to reach the server. + schema: + type: string + default: "localhost:3000/" + - variable: WebServerUrl + label: Web Server Url + description: Public/external web sever URL. + schema: + type: string + default: "localhost:3001" + - variable: Rate + label: Rate + description: The network rate used to communicate between server and client. + schema: + type: int + default: 20 + - variable: MaxConnections + label: Max Connections + description: Maximum number of concurrent players (-1 no limits). + schema: + type: int + default: -1 + # Include{containerConfig} # Include{podOptions} # Include{serviceRoot} diff --git a/charts/incubator/eco/templates/_configmap.tpl b/charts/incubator/eco/templates/_configmap.tpl new file mode 100644 index 00000000000..5c2c82f7c95 --- /dev/null +++ b/charts/incubator/eco/templates/_configmap.tpl @@ -0,0 +1,12 @@ +{{/* Define the configmap */}} +{{- define "eco.configmaps" -}} + +{{- $network := .Values.eco.network -}} + +eco-network: + enabled: true + data: + Network.eco: | + {{ $network | toJson }} + +{{- end -}} diff --git a/charts/incubator/eco/templates/common.yaml b/charts/incubator/eco/templates/common.yaml index b51394e00a4..058b6334e77 100644 --- a/charts/incubator/eco/templates/common.yaml +++ b/charts/incubator/eco/templates/common.yaml @@ -1 +1,11 @@ -{{ include "tc.v1.common.loader.all" . }} +{{/* Make sure all variables are set properly */}} +{{- include "tc.v1.common.loader.init" . -}} + +{{/* Render configmaps for all pods */}} +{{- $configmaps := include "eco.configmaps" . | fromYaml -}} +{{- if $configmaps -}} + {{- $_ := mustMergeOverwrite .Values.configmap $configmaps -}} +{{- end -}} + +{{/* Render the templates */}} +{{- include "tc.v1.common.loader.apply" . -}} diff --git a/charts/incubator/eco/values.yaml b/charts/incubator/eco/values.yaml index 3a82f1202b6..e6f1f1f47f5 100644 --- a/charts/incubator/eco/values.yaml +++ b/charts/incubator/eco/values.yaml @@ -14,17 +14,41 @@ service: main: ports: main: - port: 3001 protocol: http - targetPort: 3001 + port: 3001 game: enabled: true ports: game: enabled: true - port: 3000 protocol: udp - targetPort: 3000 + port: 3000 + +eco: + game: + id: 739590 + user: "" + password: "" + validate: false + params: [] + network: + PublicServer: true + Playtime: "" + DiscordAddress: "" + Password: "" + # server name + Description: "Truecharts ECO Server" + # server description + DetailedDescription: "Vanilla ECO game" + ServerCategory: "None" + RemoteAddress: "localhost:3000/" + IPAddress: "Any" + GameServerPort: "{{ .Values.service.game.ports.game.port }}" + WebServerPort: "{{ .Values.service.main.ports.main.port }}" + WebServerUrl: "localhost:3001" + Rate: 20 + MaxConnections: -1 + UPnPEnabled: false workload: main: @@ -35,21 +59,22 @@ workload: liveness: path: "/" type: http - port: "{{ .Values.service.main.ports.main.targetPort }}" + port: "{{ .Values.service.main.ports.main.port }}" readiness: path: "/" type: http - port: "{{ .Values.service.main.ports.main.targetPort }}" + port: "{{ .Values.service.main.ports.main.port }}" startup: type: tcp - port: "{{ .Values.service.main.ports.main.targetPort }}" + port: "{{ .Values.service.main.ports.main.port }}" env: - USERNAME: "" - PASSWRD: "" - GAME_ID: "739590" - GAME_PARAMS: "" - VALIDATE: false - # DATA_PERM: "770" + STEAMCMD_DIR: "{{ .Values.persistence.steamcmd.mountPath }}" + SERVER_DIR: "{{ .Values.persistence.serverfiles.mountPath }}" + GAME_ID: "{{ .Values.eco.game.id }}" + USERNAME: "{{ .Values.eco.game.user }}" + PASSWRD: "{{ .Values.eco.game.password }}" + GAME_PARAMS: '{{ join " " .Values.eco.game.params }}' + VALIDATE: "{{ .Values.eco.game.validate }}" persistence: steamcmd: @@ -58,6 +83,16 @@ persistence: serverfiles: enabled: true mountPath: /serverdata/serverfiles + network-config: + enabled: true + type: configmap + objectName: eco-network + targetSelector: + main: + main: + mountPath: /serverdata/serverfiles/Configs/Network.eco + subPath: Network.eco + readOnly: true portal: open: