improve minecraft performance by using a non nfs volume for live data

This commit is contained in:
2025-04-26 14:07:34 +02:00
parent 75a7f6b9b7
commit 4ebc0b1069
4 changed files with 91 additions and 2 deletions

View File

@@ -1,3 +1,11 @@
## Setup
Because minecraft is quite sensitive to io performance, we want the data to be stored on a local disk. But hostpath is not well supported in talos (and is not persistent), so we use an ephemeral volume instead. In order to do this, we create an emptyDir volume and mount it to the pod.
We use an initContaier that copies the data to the local storage. Afterwards, copying from the local storage back to the persistent storage is handled by a preStop lifecycle event.
This way, we can have the best of both worlds: fast local storage and persistent storage.
## Sending a command
```
kubectl exec -it -n minecraft deploy/minecraft-server -- /bin/bash