From c237d4ffae91edaa17ef9522ea18f6a76748a4a2 Mon Sep 17 00:00:00 2001 From: Nikolai Rodionov Date: Tue, 14 Mar 2023 14:40:09 +0000 Subject: [PATCH] Migrate minecraft to Paper (#37) I want to configure monitoring for Minecraft, and it's not possible with the Vanilla version. So we're testing Paper Reviewed-on: https://git.badhouseplants.net/badhouseplants/k8s-cluster-config/pulls/37 --- badhouseplants/values/values.minecraft.yaml | 54 ++++++++++++++++++++- common/values.service-monitor.yaml | 16 ++++++ releases.yaml | 8 +++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 common/values.service-monitor.yaml diff --git a/badhouseplants/values/values.minecraft.yaml b/badhouseplants/values/values.minecraft.yaml index 1f3c39e..41673a2 100644 --- a/badhouseplants/values/values.minecraft.yaml +++ b/badhouseplants/values/values.minecraft.yaml @@ -1,3 +1,18 @@ +--- +# -------------------------------------------------- +# -- Extensions values +# -------------------------------------------------- +service-account: + enabled: true + resources: + - name: minecraft-exporter + label: + app: minecraft-minecraft-metrics + endpoints: + port: metrics +# -------------------------------------------------- +# -- Main values +# -------------------------------------------------- resources: requests: memory: 512Mi @@ -8,11 +23,48 @@ minecraftServer: difficulty: hard hardcore: true version: 1.19.2 + type: "PAPER" + paperDownloadUrl: > + https://api.papermc.io/v2/projects/paper/versions/1.19.2/builds/307/downloads/paper-1.19.2-307.jar gameMode: survival - motd: "Suck my cock" pvp: true memory: 4096M + extraPorts: + - name: metrics + containerPort: 9225 + protocol: TCP + service: + enabled: true + embedded: false + labels: + exporter: minecraft + type: ClusterIP + port: 9925 + ingress: + enabled: false persistence: dataDir: enabled: true Size: 8Gi +initContainers: + - name: install-prometheus-exporter + image: alpine/curl + command: + - curl + - -L + - "https://github.com/sladkoff/minecraft-prometheus-exporter/releases/download/v2.5.0/minecraft-prometheus-exporter-2.5.0.jar" + - -o + - /data/plugins/prometheus-exporter.jar + volumeMounts: + - name: plugins + mountPath: /data/plugins + readOnly: false +extraVolumes: + - volumeMounts: + - name: plugins + mountPath: /data/plugins + readOnly: false + volumes: + - name: plugins + emptyDir: + sizeLimit: 500Mi diff --git a/common/values.service-monitor.yaml b/common/values.service-monitor.yaml new file mode 100644 index 0000000..f44401a --- /dev/null +++ b/common/values.service-monitor.yaml @@ -0,0 +1,16 @@ +--- +service-monitor: + templates: + - | + {{ range .Values.service-monitor.resources }} + apiVersion: monitoring.coreos.com/v1 + kind: ServiceMonitor + metadata: + name: {{ .name }} + spec: + selector: + matchLabels: + app: {{ .label.app }} + endpoints: + - port: {{ .endpoints.port }} + {{ end }} diff --git a/releases.yaml b/releases.yaml index 2359f94..b38f4f5 100644 --- a/releases.yaml +++ b/releases.yaml @@ -43,6 +43,13 @@ templates: - chart: bedag/raw version: 2.0.0 alias: istio + service-monitor: + dependencies: + - chart: bedag/raw + version: 2.0.0 + alias: service-monitor + values: + - '{{ requiredEnv "PWD" }}/common/values.service-monitor.yaml' namespace: dependencies: - chart: bedag/raw @@ -160,6 +167,7 @@ templates: version: 4.6.0 inherit: - template: default-env-values + # - template: service-monitor gitea: &gitea name: gitea