From e482059a03cf33cb51e339c77f25a30910274433 Mon Sep 17 00:00:00 2001 From: Will Anderson Date: Sun, 29 Mar 2026 20:30:50 -0500 Subject: [PATCH] fix(mudcraft): fix LuckPerms init by removing subPath mounts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SubPath mounts into plugin directories were causing k8s to create those directories owned by root before the server process could write to them. LuckPerms was failing with "Unable to create libs directory" as a result. Move config injection to the initContainer: it now cleans stale JARs (rm *.jar), copies fresh JARs from the plugins image, and pre-creates the LuckPerms and PurpurExtras directories with configs copied from ConfigMaps. Main container no longer mounts configs via subPath. Also fixes stale JAR accumulation — initContainer now clears old JARs before copying, preventing broken old versions from loading. --- servers/legion/k8s/mudcraft/statefulset.yaml | 24 +++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/servers/legion/k8s/mudcraft/statefulset.yaml b/servers/legion/k8s/mudcraft/statefulset.yaml index 54ff0c4..b393086 100644 --- a/servers/legion/k8s/mudcraft/statefulset.yaml +++ b/servers/legion/k8s/mudcraft/statefulset.yaml @@ -17,7 +17,7 @@ spec: labels: app: mudcraft annotations: - kubectl.kubernetes.io/restartedAt: "2026-03-30T01:15:00Z" + kubectl.kubernetes.io/restartedAt: "2026-03-30T02:00:00Z" spec: terminationGracePeriodSeconds: 120 initContainers: @@ -27,10 +27,24 @@ spec: - name: install-plugins image: registry.neuralplatform.ai/mudcraft/plugins:e41f6256805c28b3bb8e8832293afa3eab701082 imagePullPolicy: Always - command: ["sh", "-c", "cp -r /plugins/* /target/ && echo 'Plugins installed'"] + command: + - sh + - -c + - | + rm -rf /target/*.jar + cp -r /plugins/* /target/ + mkdir -p /target/LuckPerms + cp /luckperms-config/config.yml /target/LuckPerms/config.yml + mkdir -p /target/PurpurExtras + cp /purpurextras-config/config.yml /target/PurpurExtras/config.yml + echo 'Plugins installed' volumeMounts: - name: plugins mountPath: /target + - name: luckperms-config + mountPath: /luckperms-config + - name: purpurextras-config + mountPath: /purpurextras-config containers: - name: mudcraft image: itzg/minecraft-server:java21 @@ -75,12 +89,6 @@ spec: mountPath: /data/plugins - name: logs mountPath: /data/logs - - name: purpurextras-config - mountPath: /data/plugins/PurpurExtras/config.yml - subPath: config.yml - - name: luckperms-config - mountPath: /data/plugins/LuckPerms/config.yml - subPath: config.yml resources: requests: memory: 5Gi