diff --git a/charts/minecraft/1.0.0/Chart.yaml b/charts/minecraft/1.0.0/Chart.yaml index 090073b..6e2f7cd 100644 --- a/charts/minecraft/1.0.0/Chart.yaml +++ b/charts/minecraft/1.0.0/Chart.yaml @@ -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: 1.0.0 +version: 1.1.0 # 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.4 +appVersion: 1.0.0 diff --git a/charts/minecraft/1.0.0/README.md b/charts/minecraft/1.0.0/README.md index 7249982..0b3d699 100644 --- a/charts/minecraft/1.0.0/README.md +++ b/charts/minecraft/1.0.0/README.md @@ -1,80 +1,3 @@ -# Minecraft +# Minecraft Server -## Getting server.jar - -![Click Installations](img/main.png) -![Select the Options Menu](img/menu.png) -![Click Edit](img/edit.png) -![Click Download Server](img/server.png) - -## Running Locally - -```bash -docker-compose build minecraft -docker-compose up minecraft -``` - -## Uploading to Docker Hub - -In docker-compose.yaml, update the image tag to: - -```yaml -... -services: - minecraft: - build: . - image: /minecraft:-1 - ports: -... -``` - -then run - -```bash -docker-compose push -``` - -## Running in kubernetes - -In k8s/deploy.yaml, edit the deploy - -```yaml -... - spec: - containers: - - name: minecraft - image: - ports: -... -``` - -Then run the following - -```bash -kubectl apply -f k8s/pvc -kubectl apply -f k8s -``` - -Your minecraft server will be available on port 25565 - -## Create a Backup - -```bash -kubectl cp :/mc_data -``` - -## Restore from Backup - -```bash -kubectl cp :/mc_data -``` - -## Cool seeds - -### 7485786574821478084 - -Spawns you next to a nether portal with golden axe and pickaxe. River and Village close by. - -### -8018833100564192815 - -Use with an amplified world, massive island +Creates a vanilla Minecraft server. diff --git a/charts/minecraft/1.0.0/ix_values.yaml b/charts/minecraft/1.0.0/ix_values.yaml index 0dd21fa..4648913 100644 --- a/charts/minecraft/1.0.0/ix_values.yaml +++ b/charts/minecraft/1.0.0/ix_values.yaml @@ -1 +1,2 @@ -image: ducoterra/minecraft:1.16.4 +image: ducoterra/minecraft:latest +server_version: "1.17.1" diff --git a/charts/minecraft/1.0.0/minecraft-logo.png b/charts/minecraft/1.0.0/minecraft-logo.png new file mode 100644 index 0000000..d9ada6f Binary files /dev/null and b/charts/minecraft/1.0.0/minecraft-logo.png differ diff --git a/charts/minecraft/1.0.0/questions.yaml b/charts/minecraft/1.0.0/questions.yaml index a17f88f..0182ab7 100644 --- a/charts/minecraft/1.0.0/questions.yaml +++ b/charts/minecraft/1.0.0/questions.yaml @@ -4,21 +4,35 @@ groups: - name: "Storage" description: "Minecraft Server Storage" questions: + - variable: server_version + description: "Server Version" + label: "Version" + group: "Server Config" + schema: + type: string + default: "1.17.1" + required: false - 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/charts/minecraft/1.0.0/templates/deploy.yaml b/charts/minecraft/1.0.0/templates/deploy.yaml index aebd5e9..e6a0c7e 100644 --- a/charts/minecraft/1.0.0/templates/deploy.yaml +++ b/charts/minecraft/1.0.0/templates/deploy.yaml @@ -6,14 +6,34 @@ spec: selector: matchLabels: app: {{ .Release.Name }} + strategy: + type: Recreate template: metadata: labels: app: {{ .Release.Name }} spec: + initContainers: + - name: get-version + image: {{ .Values.get_server.image }} + imagePullPolicy: Always + env: + - name: SERVER_VERSION + value: {{ .Values.server_version }} + volumeMounts: + - mountPath: /downloads + name: data + - name: download-server + image: {{ .Values.get_server.image }} + imagePullPolicy: Always + command: ["bash", "-c", "curl -o server.jar $(cat SERVER_VERSION)"] + volumeMounts: + - mountPath: /downloads + name: data containers: - name: {{ .Release.Name }} image: {{ .Values.image }} + imagePullPolicy: Always ports: - containerPort: 25565 volumeMounts: @@ -31,13 +51,13 @@ spec: - name: MAX_RAM value: {{ .Values.max_ram | quote }} - name: MIN_RAM - value: {{ .Values.max_ram | quote }} + value: "1" resources: requests: - memory: {{ .Values.max_ram }}Gi + memory: {{ div .Values.max_ram 2 }}Gi cpu: 1m limits: - memory: {{ .Values.max_ram }}Gi + memory: {{ add 1 .Values.max_ram }}Gi cpu: {{ .Values.max_cpu | quote }} volumes: - name: data diff --git a/charts/minecraft/1.0.0/values.yaml b/charts/minecraft/1.0.0/values.yaml index ab1e939..01943f6 100644 --- a/charts/minecraft/1.0.0/values.yaml +++ b/charts/minecraft/1.0.0/values.yaml @@ -1,4 +1,7 @@ -image: ducoterra/minecraft:1.16.4 +image: ducoterra/minecraft:latest +get_server: + image: ducoterra/get-minecraft:latest +server_version: "1.17.1" port: 20101 max_cpu: 4 max_ram: 4