From 7d34b3a36cf5d122d8cc8e585e8049ccb50e743c Mon Sep 17 00:00:00 2001 From: ducoterra Date: Fri, 17 Jul 2020 13:48:19 -0400 Subject: [PATCH] add charts for each server --- helm/values.yaml | 1 - {helm => minecraft}/.helmignore | 0 minecraft/Chart.yaml | 23 +++++++++ minecraft/templates/configmap.yaml | 45 ++++++++++++++++++ {helm => minecraft}/templates/deploy.yaml | 0 {helm => minecraft}/templates/pvc.yaml | 0 {helm => minecraft}/templates/service.yaml | 0 minecraft/values.yaml | 3 ++ pubcraft/.helmignore | 23 +++++++++ {helm => pubcraft}/Chart.yaml | 0 pubcraft/templates/configmap.yaml | 45 ++++++++++++++++++ pubcraft/templates/deploy.yaml | 50 ++++++++++++++++++++ pubcraft/templates/pvc.yaml | 13 +++++ pubcraft/templates/service.yaml | 12 +++++ pubcraft/values.yaml | 3 ++ testcraft/.helmignore | 23 +++++++++ testcraft/Chart.yaml | 23 +++++++++ {helm => testcraft}/templates/configmap.yaml | 0 testcraft/templates/deploy.yaml | 50 ++++++++++++++++++++ testcraft/templates/pvc.yaml | 13 +++++ testcraft/templates/service.yaml | 12 +++++ testcraft/values.yaml | 3 ++ 22 files changed, 341 insertions(+), 1 deletion(-) delete mode 100644 helm/values.yaml rename {helm => minecraft}/.helmignore (100%) create mode 100644 minecraft/Chart.yaml create mode 100644 minecraft/templates/configmap.yaml rename {helm => minecraft}/templates/deploy.yaml (100%) rename {helm => minecraft}/templates/pvc.yaml (100%) rename {helm => minecraft}/templates/service.yaml (100%) create mode 100644 minecraft/values.yaml create mode 100644 pubcraft/.helmignore rename {helm => pubcraft}/Chart.yaml (100%) create mode 100644 pubcraft/templates/configmap.yaml create mode 100644 pubcraft/templates/deploy.yaml create mode 100644 pubcraft/templates/pvc.yaml create mode 100644 pubcraft/templates/service.yaml create mode 100644 pubcraft/values.yaml create mode 100644 testcraft/.helmignore create mode 100644 testcraft/Chart.yaml rename {helm => testcraft}/templates/configmap.yaml (100%) create mode 100644 testcraft/templates/deploy.yaml create mode 100644 testcraft/templates/pvc.yaml create mode 100644 testcraft/templates/service.yaml create mode 100644 testcraft/values.yaml diff --git a/helm/values.yaml b/helm/values.yaml deleted file mode 100644 index efd1fbc..0000000 --- a/helm/values.yaml +++ /dev/null @@ -1 +0,0 @@ -image: hub.ducoterra.net/ducoterra/minecraft \ No newline at end of file diff --git a/helm/.helmignore b/minecraft/.helmignore similarity index 100% rename from helm/.helmignore rename to minecraft/.helmignore diff --git a/minecraft/Chart.yaml b/minecraft/Chart.yaml new file mode 100644 index 0000000..730623c --- /dev/null +++ b/minecraft/Chart.yaml @@ -0,0 +1,23 @@ +apiVersion: v2 +name: minecraft +description: Personal Minecraft Server + +# 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: 1.16 + +# 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 diff --git a/minecraft/templates/configmap.yaml b/minecraft/templates/configmap.yaml new file mode 100644 index 0000000..bb0da57 --- /dev/null +++ b/minecraft/templates/configmap.yaml @@ -0,0 +1,45 @@ +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 \ No newline at end of file diff --git a/helm/templates/deploy.yaml b/minecraft/templates/deploy.yaml similarity index 100% rename from helm/templates/deploy.yaml rename to minecraft/templates/deploy.yaml diff --git a/helm/templates/pvc.yaml b/minecraft/templates/pvc.yaml similarity index 100% rename from helm/templates/pvc.yaml rename to minecraft/templates/pvc.yaml diff --git a/helm/templates/service.yaml b/minecraft/templates/service.yaml similarity index 100% rename from helm/templates/service.yaml rename to minecraft/templates/service.yaml diff --git a/minecraft/values.yaml b/minecraft/values.yaml new file mode 100644 index 0000000..7fdb787 --- /dev/null +++ b/minecraft/values.yaml @@ -0,0 +1,3 @@ +image: hub.ducoterra.net/ducoterra/minecraft +tag: 1.16.1_2 +port: 25565 \ No newline at end of file diff --git a/pubcraft/.helmignore b/pubcraft/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/pubcraft/.helmignore @@ -0,0 +1,23 @@ +# 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/ diff --git a/helm/Chart.yaml b/pubcraft/Chart.yaml similarity index 100% rename from helm/Chart.yaml rename to pubcraft/Chart.yaml diff --git a/pubcraft/templates/configmap.yaml b/pubcraft/templates/configmap.yaml new file mode 100644 index 0000000..bb0da57 --- /dev/null +++ b/pubcraft/templates/configmap.yaml @@ -0,0 +1,45 @@ +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 \ No newline at end of file diff --git a/pubcraft/templates/deploy.yaml b/pubcraft/templates/deploy.yaml new file mode 100644 index 0000000..2eef7f9 --- /dev/null +++ b/pubcraft/templates/deploy.yaml @@ -0,0 +1,50 @@ +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 }} \ No newline at end of file diff --git a/pubcraft/templates/pvc.yaml b/pubcraft/templates/pvc.yaml new file mode 100644 index 0000000..c0bccd5 --- /dev/null +++ b/pubcraft/templates/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }} + annotations: + "helm.sh/resource-policy": keep +spec: + storageClassName: nvme + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 32Gi \ No newline at end of file diff --git a/pubcraft/templates/service.yaml b/pubcraft/templates/service.yaml new file mode 100644 index 0000000..eade03e --- /dev/null +++ b/pubcraft/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + selector: + app: {{ .Release.Name }} + ports: + - port: {{ .Values.port }} + targetPort: 25565 + name: {{ .Release.Name }} + type: LoadBalancer \ No newline at end of file diff --git a/pubcraft/values.yaml b/pubcraft/values.yaml new file mode 100644 index 0000000..7f2660f --- /dev/null +++ b/pubcraft/values.yaml @@ -0,0 +1,3 @@ +image: hub.ducoterra.net/ducoterra/minecraft +tag: 1.15.2_8 +port: 20100 \ No newline at end of file diff --git a/testcraft/.helmignore b/testcraft/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/testcraft/.helmignore @@ -0,0 +1,23 @@ +# 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/ diff --git a/testcraft/Chart.yaml b/testcraft/Chart.yaml new file mode 100644 index 0000000..52c1320 --- /dev/null +++ b/testcraft/Chart.yaml @@ -0,0 +1,23 @@ +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 diff --git a/helm/templates/configmap.yaml b/testcraft/templates/configmap.yaml similarity index 100% rename from helm/templates/configmap.yaml rename to testcraft/templates/configmap.yaml diff --git a/testcraft/templates/deploy.yaml b/testcraft/templates/deploy.yaml new file mode 100644 index 0000000..2eef7f9 --- /dev/null +++ b/testcraft/templates/deploy.yaml @@ -0,0 +1,50 @@ +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 }} \ No newline at end of file diff --git a/testcraft/templates/pvc.yaml b/testcraft/templates/pvc.yaml new file mode 100644 index 0000000..c0bccd5 --- /dev/null +++ b/testcraft/templates/pvc.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ .Release.Name }} + annotations: + "helm.sh/resource-policy": keep +spec: + storageClassName: nvme + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 32Gi \ No newline at end of file diff --git a/testcraft/templates/service.yaml b/testcraft/templates/service.yaml new file mode 100644 index 0000000..eade03e --- /dev/null +++ b/testcraft/templates/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }} +spec: + selector: + app: {{ .Release.Name }} + ports: + - port: {{ .Values.port }} + targetPort: 25565 + name: {{ .Release.Name }} + type: LoadBalancer \ No newline at end of file diff --git a/testcraft/values.yaml b/testcraft/values.yaml new file mode 100644 index 0000000..272b1d8 --- /dev/null +++ b/testcraft/values.yaml @@ -0,0 +1,3 @@ +image: hub.ducoterra.net/ducoterra/minecraft +tag: 1.16.1_2 +port: 25566 \ No newline at end of file