diff --git a/charts/incubator/spaceengineers/Chart.yaml b/charts/incubator/spaceengineers/Chart.yaml index 74c2a0cd706..42f4dd109ef 100644 --- a/charts/incubator/spaceengineers/Chart.yaml +++ b/charts/incubator/spaceengineers/Chart.yaml @@ -21,7 +21,7 @@ sources: - https://github.com/truecharts/charts/tree/master/charts/incubator/spaceengineers - https://github.com/Devidian/docker-spaceengineers type: application -version: 3.0.0 +version: 3.0.1 annotations: truecharts.org/catagories: | - GameServers diff --git a/charts/incubator/spaceengineers/questions.yaml b/charts/incubator/spaceengineers/questions.yaml index 697a378427e..bb41173a0d6 100644 --- a/charts/incubator/spaceengineers/questions.yaml +++ b/charts/incubator/spaceengineers/questions.yaml @@ -55,6 +55,28 @@ questions: type: int default: 27017 required: true + - variable: steam + label: Steam Service + description: The Steam service. + schema: + additional_attrs: true + type: dict + attrs: +# Include{serviceSelectorLoadBalancer} +# Include{serviceSelectorExtras} + - variable: steam + label: Steam Service Port Configuration + schema: + additional_attrs: true + type: dict + attrs: + - variable: port + label: Port + description: This port exposes the container port on the service + schema: + type: int + default: 27018 + required: true - variable: api label: API Service description: The API service. diff --git a/charts/incubator/spaceengineers/values.yaml b/charts/incubator/spaceengineers/values.yaml index ed709dd79dd..e7ca60f4503 100644 --- a/charts/incubator/spaceengineers/values.yaml +++ b/charts/incubator/spaceengineers/values.yaml @@ -15,15 +15,20 @@ service: ports: main: protocol: udp - targetPort: 27016 port: 27017 + steam: + enabled: true + ports: + steam: + protocol: udp + enabled: true + port: 27018 api: enabled: true ports: api: protocol: http enabled: true - targetPort: 8080 port: 18080 spaceengineers: @@ -35,6 +40,35 @@ workload: podSpec: containers: main: + lifecycle: + postStart: + type: exec + command: + - /bin/sh + - -c + - | + INSTANCE_NAME="{{ .Values.spaceengineers.instance_name }}" + CONFIG_PATH="{{ .Values.persistence.instances.mountPath }}/$INSTANCE_NAME/SpaceEngineers-Dedicated.cfg" + + # Define the new values for the port-related options + ServerPort="{{ .Values.service.main.ports.main.port }}" + SteamPort="{{ .Values.service.steam.ports.steam.port }}" + RemoteApiPort="{{ .Values.service.api.ports.api.port }}" + + # Check if the configuration file exists + if [ -f "$CONFIG_PATH" ]; then + # Update the XML file with the new values using sed + sed -i "s/[0-9]*<\/SteamPort>/$SteamPort<\/SteamPort>/" "$CONFIG_PATH" + sed -i "s/[0-9]*<\/ServerPort>/$ServerPort<\/ServerPort>/" "$CONFIG_PATH" + sed -i "s/[0-9]*<\/RemoteApiPort>/$RemoteApiPort<\/RemoteApiPort>/" "$CONFIG_PATH" + + echo "Port-related options updated for instance $INSTANCE_NAME:" + echo "SteamPort: $SteamPort" + echo "ServerPort: $ServerPort" + echo "RemoteApiPort: $RemoteApiPort" + else + echo "Configuration file not found. Please create it manually or check the path: $CONFIG_PATH" + fi probes: liveness: enabled: false