Files
jklein 227bcebeb6 Bring minecraft-server up to the chart style guidelines (1.0.0+upjava8)
Stage 2 of the Fleet migration for minecraft-server. Major bump: runtime
behaviour changes (probes, hardening) and the values interface breaks
(resource renames, strict schema).

Two real bugs first:
- The container declared port 35565 while the Service targeted 25565. It
  only worked because targetPort was numeric. Both are now server.port
  (25565) and the Service targets the named port.
- The download-serverpack init container was guarded by the map
  .Values.curseforgeServerpack instead of .enabled, so it rendered for
  every release and silently no-opped on an empty wget URL.

Conventions:
- Resources renamed to <release>-<chart>-<kind>, templates to
  <app>.<kind>.yaml. The PVC deliberately keeps its historical name -
  renaming it would provision a new, empty volume and orphan the worlds.
- Probes (liveness/readiness/startup) via the image's own mc-health, so
  Ready means the server answers a server-list ping. Startup budget 20 min.
- Hardened, values-configurable security contexts: non-root uid 1000,
  read-only root filesystem with an emptyDir at /tmp, all caps dropped.
- Resources from values with the limitFactor helper; an unset memory
  request is derived from the JVM heap so the two cannot drift apart.
- Additive env block rendered through tpl, pinned init image, storage
  class as a value, RCON wiring only when actually enabled.
- curseforge/ftb/curseforgeServerpack are now mutually exclusive.
- minecraft.version is pinned to the Java line instead of LATEST.
- The mc-router auto-discovery annotation is gone; the service type it
  implicitly switched is now the explicit value server.service.type.

Schema pilot (#68): values.schema.json with additionalProperties false on
every chart-owned level, rejecting all three known dead keys.
2026-08-23 16:40:44 +02:00

73 lines
2.1 KiB
YAML

# Fixtures for the minecraft-server install-test (release name: ci).
#
# The chart hardcodes storageClassName "longhorn" in its PVC, which does not
# exist in k3d: a no-provisioner StorageClass named "longhorn" plus a pre-bound
# hostPath PV stand in for it. A node-setup Job pre-creates the hostPath
# directory world-writable, because the image's entrypoint chowns /data to
# uid 1000 and hostPath volumes do not support fsGroup.
#
# The Secret is what the 1Password operator would otherwise materialize from
# the OnePasswordItem CR the chart renders (stub CRD in ci/common/).
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: longhorn
provisioner: kubernetes.io/no-provisioner
---
apiVersion: batch/v1
kind: Job
metadata:
name: node-setup
spec:
backoffLimit: 2
template:
spec:
restartPolicy: Never
containers:
- name: setup
image: public.ecr.aws/docker/library/busybox:1.36
command:
- sh
- -c
- >
mkdir -p /pv/minecraft-server/mc-data /pv/minecraft-server/mc-modpacks &&
chmod -R 0777 /pv/minecraft-server
volumeMounts:
- name: pv
mountPath: /pv
volumes:
- name: pv
hostPath:
path: /var/lib/ci-pv
type: DirectoryOrCreate
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: ci-minecraft-server-data
spec:
capacity:
storage: 5Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
storageClassName: longhorn
claimRef:
namespace: default
name: ci-mc-volume-claim
hostPath:
path: /var/lib/ci-pv/minecraft-server
type: DirectoryOrCreate
---
apiVersion: v1
kind: Secret
metadata:
name: ci-minecraft-server-secret
stringData:
# Only consumed when server.rcon.enabled is true (RCON is off by default, and
# since chart 1.0.0 the chart no longer references the key while it is off).
rcon-password: ci-dummy-rcon-password
# Only consumed when curseforge.enabled is true; provided so the CI install
# keeps working if the test values ever enable a CurseForge modpack.
curseforge-api-key: ci-dummy-curseforge-key