From e4b3c06674815ed3a2ad23e68f75cfd2b02b8831 Mon Sep 17 00:00:00 2001 From: jklein Date: Sun, 23 Aug 2026 18:52:19 +0200 Subject: [PATCH] Restart the router when its routing config changes (2.0.0+up1.46.4) The deployment now carries a checksum/config annotation over the rendered ConfigMap, so a changed routing table produces a new pod template and a controlled rollout. Without it a mapping change was inert but looked successful: the file is mounted with subPath (kubelet never refreshes those in a running container) and mc-router reads ROUTES_CONFIG only at startup. That combination caused the minecraft-server stage-3 outage - the ConfigMap pointed at the renamed services, the running router kept proxying to the old ones, and the pod stayed Ready throughout. Major bump: runtime behaviour changes. A mapping change now costs a router restart (~4.5 s in k3d, so roughly 17-19 s in the real cluster) during which clients cannot connect. That restart is what makes the change take effect at all. Refs #82. --- minecraft-router/Chart.yaml | 2 +- .../templates/minecraft-router.deployment.yaml | 7 +++++++ minecraft-router/values.yaml | 5 +++++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/minecraft-router/Chart.yaml b/minecraft-router/Chart.yaml index 11d12ac..b778076 100644 --- a/minecraft-router/Chart.yaml +++ b/minecraft-router/Chart.yaml @@ -5,7 +5,7 @@ icon: https://avatars.githubusercontent.com/u/988985 type: application -version: 1.0.1+up1.46.4 +version: 2.0.0+up1.46.4 appVersion: "1.46.4" maintainers: diff --git a/minecraft-router/templates/minecraft-router.deployment.yaml b/minecraft-router/templates/minecraft-router.deployment.yaml index ed6d7a5..b2c66b0 100644 --- a/minecraft-router/templates/minecraft-router.deployment.yaml +++ b/minecraft-router/templates/minecraft-router.deployment.yaml @@ -14,6 +14,13 @@ spec: name: {{ .Release.Name }}-{{ .Chart.Name }}-deployment labels: app: {{ .Release.Name }}-{{ .Chart.Name }}-deployment + annotations: + # Rolls the pod whenever the rendered routing ConfigMap changes. + # Without it a changed routing table stays inert: the file is mounted + # with subPath (kubelet never refreshes those in a running container) + # and mc-router reads ROUTES_CONFIG only at startup, so the router + # would keep serving the old routes while everything looks healthy. + checksum/config: {{ include (print $.Template.BasePath "/minecraft-router.configmap.yaml") . | sha256sum }} spec: automountServiceAccountToken: false securityContext: diff --git a/minecraft-router/values.yaml b/minecraft-router/values.yaml index b0226a7..07d4784 100644 --- a/minecraft-router/values.yaml +++ b/minecraft-router/values.yaml @@ -15,6 +15,11 @@ scaleDown: false # - domain: creative.example.com # internalUrl: creative-service.minecraft.svc.cluster.local # port: 25566 +# Since chart 2.0.0 a change here rolls the router pod: the deployment carries +# a checksum/config annotation over the rendered ConfigMap. That restart is +# required for the change to take effect at all - the config is mounted with +# subPath and mc-router only reads it at startup - and costs a few seconds of +# proxy downtime, during which clients cannot connect. mappings: null server: