From 3be5111630b36453abf7a8ce1887f10bea5528c2 Mon Sep 17 00:00:00 2001 From: jklein Date: Sun, 23 Aug 2026 12:58:21 +0200 Subject: [PATCH] Import minecraft-router chart unchanged (Fleet migration stage 1) Takes the existing mc-router chart over from cluster-config as-is so the deployment can move to Fleet without any change to the rolled-out state. Convention alignment follows in stage 2, the app update in stage 3. The only deviation from "unchanged": Chart.yaml carried name: minecraft-server (copy-paste from the sister chart). The publish job pushes by the glob -*.tgz while helm package names the archive after the Chart.yaml name, so without this correction the push finds no file. Version 0.1.1+up1.25.1 - chart semver stays at 0.1.1, the +up suffix is repo policy and does not affect rendering. Also wires up CI: publish workflow, change-app-version choice list, install-test values (CI-only node-port override, since 25565 is outside the k3d default range) and the README chart table. --- .github/workflows/change-app-version.yml | 1 + .../workflows/publish-minecraft-router.yml | 15 ++++++ README.md | 1 + ci/minecraft-router/test-values.yaml | 17 +++++++ minecraft-router/.helmignore | 23 +++++++++ minecraft-router/Chart.yaml | 24 ++++++++++ .../templates/mc-router-config.yaml | 15 ++++++ .../templates/mc-router-deployment.yaml | 48 +++++++++++++++++++ .../templates/mc-router-service.yaml | 14 ++++++ minecraft-router/values.yaml | 9 ++++ 10 files changed, 167 insertions(+) create mode 100644 .github/workflows/publish-minecraft-router.yml create mode 100644 ci/minecraft-router/test-values.yaml create mode 100644 minecraft-router/.helmignore create mode 100644 minecraft-router/Chart.yaml create mode 100644 minecraft-router/templates/mc-router-config.yaml create mode 100644 minecraft-router/templates/mc-router-deployment.yaml create mode 100644 minecraft-router/templates/mc-router-service.yaml create mode 100644 minecraft-router/values.yaml diff --git a/.github/workflows/change-app-version.yml b/.github/workflows/change-app-version.yml index fe2db53..d5187d3 100644 --- a/.github/workflows/change-app-version.yml +++ b/.github/workflows/change-app-version.yml @@ -32,6 +32,7 @@ on: - patchmon - rallly - voucher-vault + - minecraft-router workflow_call: inputs: app-version: diff --git a/.github/workflows/publish-minecraft-router.yml b/.github/workflows/publish-minecraft-router.yml new file mode 100644 index 0000000..1cc56d9 --- /dev/null +++ b/.github/workflows/publish-minecraft-router.yml @@ -0,0 +1,15 @@ +name: Publish Minecraft-Router Helm Chart +on: + workflow_dispatch: + push: + branches: + - main + paths: + - minecraft-router/** +jobs: + publish-minecraft-router: + name: Publish Minecraft-Router Helm Chart + uses: ./.github/workflows/publish-helm-chart.yml + with: + chart-name: 'minecraft-router' + secrets: inherit diff --git a/README.md b/README.md index a538d72..34fb3cf 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,7 @@ Collection of some self-made helm-charts. Each top-level directory is a standalo | `gotenberg` | Gotenberg | Deployment + Service only (no ingress) | | `homeassistant` | Home Assistant | StatefulSet, has `NOTES.txt` and Helm tests | | `matrix-synapse` | Matrix Synapse | StatefulSet plus an nginx delegation Deployment/Service | +| `minecraft-router` | itzg/mc-router | Deployment + routing ConfigMap + NodePort Service (TCP only, no ingress); pre-existing chart, still on its legacy conventions | | `outline` | Outline | StatefulSet, separate DB/Redis secrets | | `paperless-ngx` | Paperless-ngx | Largest chart: consume CronJob, SMB-connector PV/PVC, pre/post-consumption scripts ConfigMap | | `patchmon` | PatchMon | Two Deployments (frontend + backend), OIDC secret | diff --git a/ci/minecraft-router/test-values.yaml b/ci/minecraft-router/test-values.yaml new file mode 100644 index 0000000..a200557 --- /dev/null +++ b/ci/minecraft-router/test-values.yaml @@ -0,0 +1,17 @@ +# minecraft-router needs no secrets, no ingress and no persistence for a CI +# install - only two adjustments to the defaults: +# +# 1. server.outwardPort: the production default 25565 is outside the Kubernetes +# default node-port range (30000-32767). The real cluster runs an extended +# --service-node-port-range, the k3d CI cluster does not, so the API server +# would reject the Service. This is a CI-only override; the chart default +# stays 25565 (see minecraft-router/values.yaml). +# 2. mappings: the chart default renders "": ":25565"; the install +# works either way, but the CI install uses a realistic routing table. +server: + outwardPort: 30565 +mappings: + - domain: mc.example.com + internalUrl: survival-service.default.svc.cluster.local + - domain: creative.example.com + internalUrl: creative-service.default.svc.cluster.local diff --git a/minecraft-router/.helmignore b/minecraft-router/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/minecraft-router/.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/minecraft-router/Chart.yaml b/minecraft-router/Chart.yaml new file mode 100644 index 0000000..d8aaaef --- /dev/null +++ b/minecraft-router/Chart.yaml @@ -0,0 +1,24 @@ +apiVersion: v2 +name: minecraft-router +description: A Helm chart for deploying a itzg/mc-router + +# 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.1+up1.25.1 + +# 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. +# It is recommended to use it with quotes. +appVersion: "1.25.1" diff --git a/minecraft-router/templates/mc-router-config.yaml b/minecraft-router/templates/mc-router-config.yaml new file mode 100644 index 0000000..aca901e --- /dev/null +++ b/minecraft-router/templates/mc-router-config.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ .Release.Name }}-config +data: + custom-routing-config.json: | + { + "mappings": { + {{- $length := len .Values.mappings }} + {{- $indexLength := sub $length 1 }} + {{- range $index, $value := .Values.mappings }} + "{{ $value.domain }}": "{{ $value.internalUrl }}:25565"{{ if lt $index $indexLength }},{{ end }} + {{- end }} + } + } diff --git a/minecraft-router/templates/mc-router-deployment.yaml b/minecraft-router/templates/mc-router-deployment.yaml new file mode 100644 index 0000000..6056383 --- /dev/null +++ b/minecraft-router/templates/mc-router-deployment.yaml @@ -0,0 +1,48 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Release.Name }}-deployment + labels: + app: {{ .Release.Name }} +spec: + replicas: 1 + selector: + matchLabels: + app: {{ .Release.Name }}-deployment + template: + metadata: + name: {{ .Release.Name }}-deployment + labels: + app: {{ .Release.Name }}-deployment + spec: + automountServiceAccountToken: false + containers: + - image: "itzg/mc-router:{{ .Chart.AppVersion }}" + name: mc-router + args: ["--api-binding", ":8080"] + ports: + - name: proxy-port + containerPort: 25565 + - name: api-port + containerPort: 8080 + env: + - name: ROUTES_CONFIG + value: /data/custom-routing-config.json + resources: + requests: + memory: 50Mi + cpu: "100m" + ephemeral-storage: "50Mi" + limits: + memory: 100Mi + cpu: "250m" + ephemeral-storage: "500Mi" + volumeMounts: + - name: config-mount + mountPath: /data/custom-routing-config.json + subPath: custom-routing-config.json + + volumes: + - name: config-mount + configMap: + name: {{ .Release.Name }}-config \ No newline at end of file diff --git a/minecraft-router/templates/mc-router-service.yaml b/minecraft-router/templates/mc-router-service.yaml new file mode 100644 index 0000000..c301527 --- /dev/null +++ b/minecraft-router/templates/mc-router-service.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ .Release.Name }}-service +spec: + selector: + app: {{ .Release.Name }}-deployment + ports: + - nodePort: {{ .Values.server.outwardPort }} + port: 25565 + targetPort: 25565 + name: proxy-port + type: NodePort + \ No newline at end of file diff --git a/minecraft-router/values.yaml b/minecraft-router/values.yaml new file mode 100644 index 0000000..5ce1fd5 --- /dev/null +++ b/minecraft-router/values.yaml @@ -0,0 +1,9 @@ +server: + # nodePort of the router Service. 25565 is the Minecraft default port and is + # deliberately outside the Kubernetes default node-port range (30000-32767) - + # the cluster runs an extended --service-node-port-range. Do NOT "fix" this + # into the default range: the Minecraft clients connect to this exact port. + outwardPort: 25565 +mappings: + - domain: null + internalUrl: null \ No newline at end of file