45 Commits

Author SHA1 Message Date
ducoterra
a07400506a Add '.gitlab/' from commit '731ada6a3d65b2347ccf204cfe09ee278a4f0594'
git-subtree-dir: .gitlab
git-subtree-mainline: 422f4d49bd
git-subtree-split: 731ada6a3d
2021-11-02 11:59:31 -04:00
ducoterra
422f4d49bd remove .gitlab subtree 2021-11-02 11:59:08 -04:00
Reese
731ada6a3d Merge branch 'make-update-fixes' into 'main'
Update README with "common" remote

See merge request services/common!4
2021-11-02 15:50:30 +00:00
ducoterra
c3e6d733c6 Switch to "subtree split" push strategy
Split the subtree into a new branch before pushing to common. This
creates a new branch automatically and ensures no weird histories get
committed to common.
2021-11-02 11:48:15 -04:00
ducoterra
3c91292fea Make user stash their own damn changes
Stashing is so annoying to deal with in a scripted way. Just force the
user to stash their own changes. Only subtree pull if it's possible.
2021-11-02 11:47:29 -04:00
ducoterra
d86b5052a8 Add PROJECT_NAME and VERSION
Add PROJECT_NAME and VERSION variables to Makefile.
2021-11-02 11:46:53 -04:00
ducoterra
9d0c9c6388 Update README with "common" remote
Add instructions for adding subtree using a remote called "common". You
need the remote to properly contribute back upstream from a child
project.
2021-11-02 11:45:57 -04:00
Reese
30fb8c2171 Merge branch 'docker-buidlx-overhaul' into 'main'
Switch to container-builder buildx platform

See merge request services/common!2
2021-11-02 15:44:36 +00:00
Reese
fd96b3f3a3 Merge branch 'git-release' into 'main'
Add make git-release

See merge request services/common!3
2021-11-02 15:44:26 +00:00
ducoterra
a6053ed3f0 Add make git-release
Add command which makes an automated release from the VERSION file.
Commits and tags everything not staged in the repo.
2021-11-02 10:25:18 -04:00
ducoterra
3563c5c2aa Add make docker-release
Add docker-release command which updates the image tag in the
docker-compose.yaml and runs a `make push`.
2021-11-02 10:23:53 -04:00
ducoterra
40a217b585 Use buildx to create multi-arch images
clear and set the buildx context on push. Then use --push with buildx
build to push the multi-arch images immediately after creating them.
This gets around the need to store them locally (which won't work for
something like an M1 mac).
2021-11-02 10:22:48 -04:00
ducoterra
5e2bc5f872 Switch to container-builder buildx platform
Continue using buildx with a new container builder name
"container-builder".
2021-11-02 10:19:21 -04:00
ducoterra
a5aa0cacbe Automated release for version 1.0.2 2021-11-02 10:08:38 -04:00
ducoterra
65b3a84e96 make subtree "split" overhaul
In order to create cleaner histories we should be using subtree split
and push in order to preview the changes as an MR before pushing to
main.
2021-11-02 10:07:50 -04:00
ducoterra
d181d452e8 Overhaul for get-server v. 2.0.0
Since get-server downloads its own jarfile this commit overhauls a lot
of the minecraft deploy to match the new strategy. It also updates the
README and adds makefile targets for a few new commands.
2021-11-02 10:05:01 -04:00
ducoterra
9eed50962c Don't squash on pull
Don't squash updates on pull
2021-11-01 20:32:27 -04:00
ducoterra
b07a2c095b Run update after make-push
To close things out we should re-run make-update to ensure changes are
pulled back into the repo we updated from.
2021-11-01 10:05:43 -04:00
ducoterra
22a952dd53 Remove warning from make-update
make-update isn't as destructive as it once was. It should be safe to
run as long as the developer is fixes any weird merge conflicts after
stash pop.
2021-11-01 10:02:35 -04:00
ducoterra
0f6eeb776e Add make-stash-drop command
Sometimes you can get stuck in a loop where git stash pop preserves the
stash commit. Dropping that commit if it's a STASH commit after an
update is totally fine.
2021-11-01 10:01:12 -04:00
ducoterra
f81d846f31 Only pop stash if changes
Only pop the stash if the most recent stash commit matches the STASH
name.
2021-11-01 09:56:37 -04:00
ducoterra
afed93f58a Add warning to make-update and make-push
Add warning before make-update and make-push to alert developers that
running the commands might be destructive. Allow cancelling the command
up to 3 seconds before continuing. Also explain that merge conflicts
warrant a re-run of the command.
2021-11-01 09:38:00 -04:00
ducoterra
6239af7f74 Ignore git stash pop failures
In the event the stash is empty, don't run stash pop.
2021-11-01 09:23:36 -04:00
ducoterra
2f767593ef Add make-push command
Add command to update the subtree from a child repo. This pushes to the
main branch of the common repo with only the relevant commits.
2021-11-01 09:20:11 -04:00
ducoterra
66b4fdb902 Ignore subtree pull failures
Rather than potentially leaving the developer in a state where `git
stash pop` wasn't run, ignore failures in git subtree and let the
developer fix issues and re-run the command. This makes `make-update`
more idempotent.
2021-11-01 09:13:15 -04:00
ducoterra
da69418b0d Switch to url-based subtree with make-update
Add new `make-update` make command to update the .gitlab subtree.
2021-10-31 22:56:47 -04:00
ducoterra
ba12c923ba Remove docker-run
Docker-run was only useful in very specific projects. Projects should
either define their own "run" in their Makefile, add a
docker-compose.yaml, or specify instructions in the README.
2021-10-31 20:59:29 -04:00
ducoterra
74a4a4e77f Transition to .gitlab prefix
Expect repo to be subtree'd as ".gitlab"
2021-10-31 20:33:47 -04:00
ducoterra
3e8ca71358 Add chart-release to truenas.makefile
Add chart-release to add a subtree chart to the charts releases in the
charts repo.
2021-10-31 20:22:20 -04:00
ducoterra
4146777f85 Add helm.makefile
Add helm.makefile with a helm-release command to make a helm release.
2021-10-31 20:21:08 -04:00
ducoterra
8a52a21a39 Switch to multi-makefile strategy
Instead of putting everything in one makefile switch to a folder called
"make" with multiple makefiles. Move the original makefile to
"docker.makefile" and add kaniko and truenas to fill in later.
2021-10-31 15:03:59 -04:00
ducoterra
8d190e478f Add minecraft logo
Add minecraft logo for use by nextcloud.
2021-10-30 22:32:59 -04:00
ducoterra
ba5ab53bdb Allow custom server versions
Allow user to specify server version. Download on server init.
2021-10-30 22:32:52 -04:00
ducoterra
f18752299d init 2021-10-30 22:28:20 -04:00
ducoterra
9e788ee711 Add IMAGE and VERSION files
Makefile requires IMAGE and VERSION files available to build and push.
2021-10-30 21:02:40 -04:00
ducoterra
d3b0f86f40 Switch to openjdk-latest and don't copy server.jar
No longer copying server.jar since we expected it to exist already.
Build using the latest version of openjdk.
2021-10-30 21:02:01 -04:00
ducoterra
2f7d4c7f83 Add Makefile
Add Makefile with build, run, and push commands.
2021-10-30 21:01:43 -04:00
ducoterra
aa253e6688 Remove server.jar and docker-compose.yaml
Remove unused files.
2021-10-30 21:01:22 -04:00
ducoterra
773c1d6020 Move install-specific values to a values folder
To keep things tidy all the various values files have been moved to a
directory named "values".
2021-10-30 20:59:10 -04:00
ducoterra
dae5a097e9 Fix RAM issue with deploy
A deploy was running the same max ram for both the pod and the java
app. This led to issues where the java app would use its max ram and the
pod would think it was out of memory. It would kill the pod and the
minecraft server with it, often not saving the last few minutes of
progress.

Now the deploy runs 1GiB extra ram than the java app.
2021-09-11 14:08:38 -04:00
ducoterra
44053abdf8 truenas compatibility update 2021-08-29 15:24:11 -04:00
ducoterra
807b1866a8 set memory requirements to avoid sudden container death 2021-02-20 12:16:05 -05:00
ducoterra
99666bab94 add setenv 2021-02-05 21:47:13 -05:00
ducoterra
1b6b8bb281 update RAM for new cluster 2021-02-05 21:42:48 -05:00
ducoterra
95c7fa79f3 merge templates 2020-11-27 15:30:43 -05:00
48 changed files with 422 additions and 447 deletions

3
.gitignore vendored
View File

@@ -1 +1,2 @@
data/ data/
world/

34
.gitlab/Makefile Normal file
View File

@@ -0,0 +1,34 @@
SHELL := /bin/bash
PROJECT_NAME ?= $(shell git config --local remote.origin.url|sed -n 's#.*/\([^.]*\)\.git#\1#p')
VERSION ?= $(shell cat VERSION)
IMAGE ?= $(shell cat IMAGE):$(VERSION)
IMAGE_LATEST ?= $(shell cat IMAGE):latest
PWD ?= $(shell pwd)
STASH ?= "common-update-stash"
include .gitlab/make/docker.makefile
include .gitlab/make/helm.makefile
include .gitlab/make/kaniko.makefile
include .gitlab/make/truenas.makefile
include .gitlab/make/git.makefile
.PHONY: warning
warning:
@printf "Running a potentially destructive command. If a conflict occurs, fix the conflict and re-run the command.\n"
@printf "Cancel with ctrl + c within 3 seconds."
@sleep 3
.PHONY: make-stash-drop
make-stash-drop:
@if [ ! -z "$$(git stash list | grep -r 'stash@{0}.*common')" ]; then git stash drop; fi
.PHONY: make-update
make-update:
@git subtree pull --prefix .gitlab --message "Merge update from Common" -q common main
.PHONY: make-push
make-push: warning
@make make-update
@git subtree split --branch common/$(PROJECT_NAME) --prefix .gitlab
@git push common common/$(PROJECT_NAME):common/$(PROJECT_NAME)

10
.gitlab/README.md Normal file
View File

@@ -0,0 +1,10 @@
# Adding the "common" subtree as your .gitlab folder
```bash
# Add the subtree as a remote
git remote add common git@gitlab.ducoterra.net:services/common.git
git subtree add --prefix .gitlab common main
# Now you can run the following to update
make make-update
```

View File

@@ -0,0 +1,29 @@
.PHONY: docker-init
docker-init:
@touch VERSION
@touch IMAGE
.PHONY: buildx-context
buildx-context:
docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64
.PHONY: buildx-clear
buildx-clear:
docker buildx rm container-builder
.PHONY: build
build:
docker buildx build --load . -t $(IMAGE)
@docker buildx build --load . -t $(IMAGE_LATEST)
.PHONY: push
push:
-make buildx-clear
@make buildx-context
docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE)
@docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE_LATEST)
.PHONY: docker-release
docker-release:
@yq e ".services.minecraft.image = \"$(IMAGE)\"" -i docker-compose.yaml
@make push

View File

@@ -0,0 +1,5 @@
.PHONY: git-release
git-release:
@git add .
@git commit -m "Automated release for version $(VERSION)"
@git tag $(VERSION)

View File

@@ -0,0 +1,4 @@
.PHONY: helm-release
helm-release:
@yq e ".version = \"$(shell cat VERSION)\"" -i helm/Chart.yaml
@yq e ".appVersion = \"$(shell cat VERSION)\"" -i helm/Chart.yaml

View File

View File

@@ -0,0 +1,3 @@
.PHONY: chart-release
chart-release:
@rsync -av $(CHART)/helm/ charts/$(CHART)/$(shell cat $(CHART)/VERSION)/

View File

@@ -1,11 +1,10 @@
FROM openjdk:8-slim FROM openjdk:latest
COPY server.jar /server.jar RUN groupadd -r minecraft -g 2000
RUN useradd --no-log-init minecraft -u 2000 -g 2000 -m
RUN groupadd -r minecraft && useradd --no-log-init -r -g minecraft minecraft
WORKDIR /mc_data WORKDIR /mc_data
RUN chown -R minecraft:minecraft . RUN chown -R minecraft:minecraft .
USER minecraft USER minecraft
# Copy files only if they don't yet exist (server.jar, server.properties, etc) and start the server # 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 CMD java -Xmx"$MAX_RAM"G -Xms"$MIN_RAM"G -jar ./server.jar nogui

1
IMAGE Normal file
View File

@@ -0,0 +1 @@
ducoterra/minecraft

13
Makefile Normal file
View File

@@ -0,0 +1,13 @@
SHELL := /bin/bash
include .gitlab/Makefile
.PHONY: get-server
get-server:
@mkdir -p world
@echo 'eula=true' > world/eula.txt
@docker run -it -e SERVER_VERSION=1.17.1 -v $(PWD)/world:/downloads ducoterra/get-minecraft:latest
.PHONY: run
run:
docker-compose run --service-ports minecraft

View File

@@ -1,61 +1,34 @@
# Minecraft # Minecraft
## 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 ## Running Locally
```bash ```bash
docker-compose build minecraft # download the most recent version of minecraft
docker-compose up minecraft make get-server
# Run the server
docker-compose up
``` ```
## Uploading to Docker Hub ## Uploading to Docker Hub
In docker-compose.yaml, update the image tag to: 1. Update the version in the VERSION file.
2. Build and push the new version
```yaml ```bash
... make build
services: make push
minecraft: ```
build: .
image: <your_username>/minecraft:<version>-1
ports:
...
```
then run
```bash
docker-compose push
```
## Running in kubernetes ## Running in kubernetes
In k8s/deploy.yaml, edit the deploy Requires helm v3. Edit values.yaml and run the following:
```yaml
...
spec:
containers:
- name: minecraft
image: <your image from above>
ports:
...
```
Then run the following
```bash ```bash
kubectl apply -f k8s/pvc helm upgrade --install minecraft
kubectl apply -f k8s
``` ```
Your minecraft server will be available on port 25565 Your minecraft server will be available on port 25565 by default.
## Create a Backup ## Create a Backup

1
VERSION Normal file
View File

@@ -0,0 +1 @@
1.0.2

View File

@@ -1,6 +1,13 @@
version: '3' version: '3'
services: services:
minecraft: minecraft:
build: . image: ducoterra/minecraft:1.0.2
image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_3 stdin_open: true
tty: true
volumes:
- ./world:/mc_data
ports:
- 25565:25565
environment:
- MAX_RAM=1
- MIN_RAM=1

View File

@@ -1,7 +1,6 @@
apiVersion: v2 apiVersion: v2
name: minecraft name: minecraft
description: Personal Minecraft Server description: A Minecraft server for kubernetes
# A chart can be either an 'application' or a 'library' chart. # A chart can be either an 'application' or a 'library' chart.
# #
# Application charts are a collection of templates that can be packaged into versioned archives # Application charts are a collection of templates that can be packaged into versioned archives
@@ -11,13 +10,11 @@ description: Personal Minecraft Server
# a dependency of application charts to inject those utilities and functions into the rendering # a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed. # pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application type: application
# This is the chart version. This version number should be incremented each time you make changes # 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. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.16 version: 1.0.2
# This is the version number of the application being deployed. This version number should be # 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 # 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. # follow Semantic Versioning. They should reflect the version the application is using.
appVersion: 1.16 appVersion: 1.0.2

3
helm/README.md Normal file
View File

@@ -0,0 +1,3 @@
# Minecraft Server
Creates a vanilla Minecraft server.

3
helm/app-readme.md Normal file
View File

@@ -0,0 +1,3 @@
# Minecraft Server
Creates a vanilla Minecraft server.

2
helm/ix_values.yaml Normal file
View File

@@ -0,0 +1,2 @@
image: ducoterra/minecraft:latest
server_version: "1.17.1"

BIN
helm/minecraft-logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 268 KiB

38
helm/questions.yaml Normal file
View File

@@ -0,0 +1,38 @@
groups:
- name: "Server Config"
description: "Minecraft Server Configuration"
- 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

View File

@@ -0,0 +1,8 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
data:
eula.txt: |
eula=true
server.properties: {{ toYaml .Values.server_props | indent 2 }}

View File

@@ -6,14 +6,27 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: {{ .Release.Name }} app: {{ .Release.Name }}
strategy:
type: Recreate
template: template:
metadata: metadata:
labels: labels:
app: {{ .Release.Name }} app: {{ .Release.Name }}
spec: 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
containers: containers:
- name: {{ .Release.Name }} - name: {{ .Release.Name }}
image: {{ .Values.image }} image: {{ .Values.image }}
imagePullPolicy: Always
ports: ports:
- containerPort: 25565 - containerPort: 25565
volumeMounts: volumeMounts:
@@ -29,20 +42,22 @@ spec:
stdin: true stdin: true
env: env:
- name: MAX_RAM - name: MAX_RAM
value: "4" value: {{ .Values.max_ram | quote }}
- name: MIN_RAM - name: MIN_RAM
value: "1" value: "1"
resources: resources:
requests: requests:
memory: "2Gi" memory: {{ div .Values.max_ram 2 }}Gi
cpu: 250m cpu: 1m
limits: limits:
memory: "8Gi" memory: {{ add 1 .Values.max_ram }}Gi
cpu: "4" cpu: {{ .Values.max_cpu | quote }}
volumes: volumes:
- name: data - name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ .Release.Name }} claimName: {{ .Release.Name }}
- name: properties - name: properties
configMap: configMap:
name: {{ .Release.Name }} name: {{ .Release.Name }}
securityContext:
fsGroup: 2000

View File

@@ -5,7 +5,6 @@ metadata:
annotations: annotations:
"helm.sh/resource-policy": keep "helm.sh/resource-policy": keep
spec: spec:
storageClassName: nvme
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:

45
helm/values.yaml Normal file
View File

@@ -0,0 +1,45 @@
image: ducoterra/minecraft:latest
get_server:
image: ducoterra/get-minecraft:2.0.0
server_version: "1.17.1"
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

View File

@@ -1,45 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
data:
eula.txt: |
eula=true
server.properties: |
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

View File

@@ -1,50 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: {{ .Release.Name }}
image: {{ .Values.image }}:{{ .Values.tag }}
ports:
- containerPort: 25565
volumeMounts:
- mountPath: /mc_data
name: data
- name: properties
mountPath: /mc_data/server.properties
subPath: server.properties
- name: properties
mountPath: /mc_data/eula.txt
subPath: eula.txt
tty: true
stdin: true
env:
- name: MAX_RAM
value: "4"
- name: MIN_RAM
value: "1"
- name: THREADS
value: "4"
resources:
requests:
memory: "2Gi"
cpu: 250m
limits:
memory: "8Gi"
cpu: "4"
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}
- name: properties
configMap:
name: {{ .Release.Name }}

View File

@@ -1,13 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}
annotations:
"helm.sh/resource-policy": keep
spec:
storageClassName: nvme
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 32Gi

View File

@@ -1,3 +0,0 @@
image: hub.ducoterra.net/ducoterra/minecraft
tag: 1.16.1_2
port: 25565

View File

@@ -1,23 +0,0 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -1,23 +0,0 @@
apiVersion: v2
name: charts
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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
# 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

View File

@@ -1,45 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
data:
eula.txt: |
eula=true
server.properties: |
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

View File

@@ -1,50 +0,0 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ .Release.Name }}
spec:
containers:
- name: {{ .Release.Name }}
image: {{ .Values.image }}
ports:
- containerPort: 25565
volumeMounts:
- mountPath: /mc_data
name: data
- name: properties
mountPath: /mc_data/server.properties
subPath: server.properties
- name: properties
mountPath: /mc_data/eula.txt
subPath: eula.txt
tty: true
stdin: true
env:
- name: MAX_RAM
value: "4"
- name: MIN_RAM
value: "1"
- name: THREADS
value: "4"
resources:
requests:
memory: "2Gi"
cpu: 250m
limits:
memory: "8Gi"
cpu: "4"
volumes:
- name: data
persistentVolumeClaim:
claimName: {{ .Release.Name }}
- name: properties
configMap:
name: {{ .Release.Name }}

View File

@@ -1,12 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
spec:
selector:
app: {{ .Release.Name }}
ports:
- port: {{ .Values.port }}
targetPort: 25565
name: {{ .Release.Name }}
type: LoadBalancer

View File

@@ -1,2 +0,0 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_2
port: 20100

Binary file not shown.

1
setenv.sh Executable file
View File

@@ -0,0 +1 @@
kubectl config set current-context k3os-alpha.dnet-ducoterra-minecraft

View File

@@ -1,23 +0,0 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

View File

@@ -1,23 +0,0 @@
apiVersion: v2
name: charts
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
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
# 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

View File

@@ -1,45 +0,0 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}
data:
eula.txt: |
eula=true
server.properties: |
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=amplified
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=512
level-seed=
prevent-proxy-connections=false
use-native-transport=true
motd=This is gonna be interesting
enable-rcon=false

View File

@@ -1,13 +0,0 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Release.Name }}
annotations:
"helm.sh/resource-policy": keep
spec:
storageClassName: nvme
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 32Gi

View File

@@ -1,12 +0,0 @@
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}
spec:
selector:
app: {{ .Release.Name }}
ports:
- port: {{ .Values.port }}
targetPort: 25565
name: {{ .Release.Name }}
type: LoadBalancer

View File

@@ -1,2 +0,0 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.1_3
port: 25566

View File

@@ -0,0 +1,42 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.4
port: 20101
max_cpu: 8
max_ram: 8
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

View File

@@ -0,0 +1,42 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.4
port: 25565
max_cpu: 8
max_ram: 6
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

View File

@@ -0,0 +1,42 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.4
port: 20100
max_cpu: 8
max_ram: 6
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

View File

@@ -0,0 +1,42 @@
image: hub.ducoterra.net/ducoterra/minecraft:1.16.4
port: 25566
max_cpu: 8
max_ram: 6
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=amplified
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=64
resource-pack=
spawn-animals=true
white-list=true
generate-structures=true
online-mode=true
max-build-height=512
level-seed=
prevent-proxy-connections=false
use-native-transport=true
motd=This is gonna be interesting
enable-rcon=false