From 44053abdf80bf3c7283fef1fd5bdce4d29a9537e Mon Sep 17 00:00:00 2001 From: ducoterra Date: Sun, 29 Aug 2021 15:24:11 -0400 Subject: [PATCH] truenas compatibility update --- Dockerfile | 5 +++-- helm/Chart.yaml | 8 ++++---- helm/README.md | 3 +++ helm/app-readme.md | 3 +++ helm/ix_values.yaml | 1 + helm/questions.yaml | 30 +++++++++++++++++++++++++++ helm/templates/deploy.yaml | 6 +++++- helm/values.yaml | 42 ++++++++++++++++++++++++++++++++++++++ 8 files changed, 91 insertions(+), 7 deletions(-) create mode 100644 helm/README.md create mode 100644 helm/app-readme.md create mode 100644 helm/ix_values.yaml create mode 100644 helm/questions.yaml create mode 100644 helm/values.yaml diff --git a/Dockerfile b/Dockerfile index 54d95d0..c77c9c0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,11 @@ FROM openjdk:8-slim COPY server.jar /server.jar -RUN groupadd -r minecraft && useradd --no-log-init -r -g minecraft minecraft +RUN groupadd -r minecraft -g 2000 +RUN useradd --no-log-init minecraft -u 2000 -g 2000 -m WORKDIR /mc_data RUN chown -R minecraft:minecraft . USER minecraft # Copy files only if they don't yet exist (server.jar, server.properties, etc) and start the server -CMD java -Xmx"$MAX_RAM"G -Xms"$MIN_RAM"G -jar /server.jar nogui \ No newline at end of file +CMD java -Xmx"$MAX_RAM"G -Xms"$MIN_RAM"G -jar /server.jar nogui diff --git a/helm/Chart.yaml b/helm/Chart.yaml index cf7bc40..267e7c7 100644 --- a/helm/Chart.yaml +++ b/helm/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 -name: helm -description: A Helm chart for Kubernetes +name: minecraft +description: A Minecraft server for kubernetes # A chart can be either an 'application' or a 'library' chart. # @@ -15,9 +15,9 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 1.16.0 +appVersion: 1.16.4 diff --git a/helm/README.md b/helm/README.md new file mode 100644 index 0000000..0b3d699 --- /dev/null +++ b/helm/README.md @@ -0,0 +1,3 @@ +# Minecraft Server + +Creates a vanilla Minecraft server. diff --git a/helm/app-readme.md b/helm/app-readme.md new file mode 100644 index 0000000..0b3d699 --- /dev/null +++ b/helm/app-readme.md @@ -0,0 +1,3 @@ +# Minecraft Server + +Creates a vanilla Minecraft server. diff --git a/helm/ix_values.yaml b/helm/ix_values.yaml new file mode 100644 index 0000000..0dd21fa --- /dev/null +++ b/helm/ix_values.yaml @@ -0,0 +1 @@ +image: ducoterra/minecraft:1.16.4 diff --git a/helm/questions.yaml b/helm/questions.yaml new file mode 100644 index 0000000..82aea13 --- /dev/null +++ b/helm/questions.yaml @@ -0,0 +1,30 @@ +groups: + - name: "Server Config" + description: "Minecraft Server Configuration" + - name: "Storage" + description: "Minecraft Server Storage" +questions: + - variable: port + description: "Listen Port" + group: "Server Config" + label: "Port" + schema: + type: int + default: 25565 + required: true + - variable: max_ram + description: "Total RAM allocated to the server" + group: "Server Config" + label: "RAM Limit (GiB)" + schema: + type: int + default: 4 + required: true + - variable: max_cpu + description: "# CPU Cores Allocated to the server" + group: "Server Config" + label: "CPU Limit (# Cores)" + schema: + type: int + default: 4 + required: true diff --git a/helm/templates/deploy.yaml b/helm/templates/deploy.yaml index 0f57ddb..6f5a27e 100644 --- a/helm/templates/deploy.yaml +++ b/helm/templates/deploy.yaml @@ -6,6 +6,8 @@ spec: selector: matchLabels: app: {{ .Release.Name }} + updateStrategy: + type: Recreate template: metadata: labels: @@ -45,4 +47,6 @@ spec: claimName: {{ .Release.Name }} - name: properties configMap: - name: {{ .Release.Name }} \ No newline at end of file + name: {{ .Release.Name }} + securityContext: + fsGroup: 2000 diff --git a/helm/values.yaml b/helm/values.yaml new file mode 100644 index 0000000..ab1e939 --- /dev/null +++ b/helm/values.yaml @@ -0,0 +1,42 @@ +image: ducoterra/minecraft:1.16.4 +port: 20101 +max_cpu: 4 +max_ram: 4 +server_props: | + max-tick-time=60000 + generator-settings= + force-gamemode=false + allow-nether=true + gamemode=0 + broadcast-console-to-ops=true + enable-query=false + player-idle-timeout=0 + difficulty=3 + spawn-monsters=true + op-permission-level=4 + pvp=true + snooper-enabled=true + level-type=default + hardcore=false + enable-command-block=false + max-players=20 + network-compression-threshold=256 + resource-pack-sha1= + max-world-size=29999984 + server-port=25565 + server-ip= + spawn-npcs=true + allow-flight=true + level-name=world + view-distance=32 + resource-pack= + spawn-animals=true + white-list=true + generate-structures=true + online-mode=true + max-build-height=256 + level-seed= + prevent-proxy-connections=false + use-native-transport=true + motd=This is gonna be interesting + enable-rcon=false