Migrate minecraft

This commit is contained in:
Nikolai Rodionov 2025-04-07 15:37:04 +02:00
parent 6855a5c43c
commit 8a595bfdbc
No known key found for this signature in database
GPG Key ID: 0639A45505F3BFA6
5 changed files with 69 additions and 56 deletions

View File

@ -1,5 +1,5 @@
#helmDefaults: helmDefaults:
# kubeContext: "{{ `{{ .StateValues.kubeContext }}` }}" kubeContext: {{ .StateValues.kubeContext }}
templates: templates:
# --------------------------- # ---------------------------
@ -71,7 +71,7 @@ templates:
version: 2.0.0 version: 2.0.0
alias: traefik alias: traefik
values: values:
- '{{ requiredEnv "PWD" }}/values/common/values.tcp-route.yaml' - '../values/common/values.tcp-route.yaml'
ext-udp-routes: ext-udp-routes:
dependencies: dependencies:
- chart: bedag/raw - chart: bedag/raw

View File

@ -4,6 +4,10 @@ bases:
repositories: repositories:
- name: gitea - name: gitea
url: https://dl.gitea.io/charts/ url: https://dl.gitea.io/charts/
- name: bedag
url: https://bedag.github.io/helm-charts/
- name: minecraft
url: https://itzg.github.io/minecraft-server-charts/
releases: releases:
- name: app-gitea - name: app-gitea
@ -13,3 +17,12 @@ releases:
inherit: inherit:
- template: env-values - template: env-values
- template: env-secrets - template: env-secrets
- name: minecraft
chart: minecraft/minecraft
namespace: games
version: 4.26.1
inherit:
- template: common-values-tpl
- template: env-values
- template: env-secrets

View File

@ -1,33 +1,15 @@
service-account:
enabled: true
resources:
- name: minecraft-exporter
label:
app: minecraft-minecraft-metrics
endpoints:
port: metrics
traefik:
enabled: true
tcpRoutes:
- name: minecraft-tcp
entrypoint: minecraft
gateway: istio-system/badhouseplants-minecraft
match: HostSNI(`*`)
service: minecraft
port: 25565
# -------------------------------------------------- # --------------------------------------------------
# -- Main values # -- Main values
# -------------------------------------------------- # --------------------------------------------------
image: image:
#tag: java21-graalvm tag: java23-graalvm
tag: java21-jdk
pullPolicy: Always pullPolicy: Always
resources: resources:
requests: requests:
memory: 3.5Gi memory: 2.5Gi
cpu: 2.5 cpu: 2.5
limits: limits:
memory: 3.5Gi memory: 2.5Gi
lifecycle: lifecycle:
postStart: postStart:
- bash - bash
@ -52,11 +34,11 @@ readinessProbe:
successThreshold: 1 successThreshold: 1
timeoutSeconds: 20 timeoutSeconds: 20
minecraftServer: minecraftServer:
memory: 3000M memory: 2000M
jvmOpts: | jvmOpts: |
-server -server
jvmXXOpts: | jvmXXOpts: |
-Xms3000G -Xmx3500G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Xms2000G -Xmx2500G -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
overrideServerProperties: true overrideServerProperties: true
eula: "TRUE" eula: "TRUE"
onlineMode: false onlineMode: false
@ -89,7 +71,6 @@ minecraftServer:
enabled: false enabled: false
persistence: persistence:
storageClass: openebs-hostpath storageClass: openebs-hostpath
#storageClass: local-path
dataDir: dataDir:
enabled: true enabled: true
Size: 9Gi Size: 9Gi
@ -112,35 +93,6 @@ mcbackup:
persistence: persistence:
backupDir: backupDir:
enabled: false enabled: false
# ---------------------------------------------
# -- Install Plugins
# ---------------------------------------------
initContainers:
- name: 0-download-mods
image: alpine/curl
command:
- curl
- -L
- "https://s3.badhouseplants.net/minecraft-mods/server_mods.tar"
- -o
- /download/server_mods.tar
volumeMounts:
- name: download
mountPath: /download
readOnly: false
- name: 1-copy-plugins-to-minecraft
image: ubuntu
command:
- sh
- -c
- cd /mods && tar -xvf /download/server_mods.tar || true
volumeMounts:
- name: plugins
mountPath: /mods
readOnly: false
- name: download
mountPath: /download
readOnly: false
extraVolumes: extraVolumes:
- volumeMounts: - volumeMounts:
- name: plugins - name: plugins
@ -171,3 +123,18 @@ extraDeploy:
selector: selector:
matchLabels: matchLabels:
app.kubernetes.io/instance: minecraft app.kubernetes.io/instance: minecraft
- |-
apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: minecraft-tcp
spec:
entryPoints:
- minecraft
routes:
- match: HostSNI(`*`)
services:
- name: minecraft
nativeLB: true
port: 25565

View File

@ -0,0 +1,33 @@
image:
repository: {{ .Values.registry }}/itzg/minecraft-server
pullSecret: regcred
# ---------------------------------------------
# -- Install Plugins
# ---------------------------------------------
initContainers:
- name: 0-download-mods
image: {{.Values.registry}}/alpine/curl
command:
- curl
- -L
- "https://s3.badhouseplants.net/minecraft-mods/server_mods.tar"
- -o
- /download/server_mods.tar
volumeMounts:
- name: download
mountPath: /download
readOnly: false
- name: 1-copy-plugins-to-minecraft
image: {{ .Values.registry }}/ubuntu
command:
- sh
- -c
- cd /mods && tar -xvf /download/server_mods.tar || true
volumeMounts:
- name: plugins
mountPath: /mods
readOnly: false
- name: download
mountPath: /download
readOnly: false