-
Notifications
You must be signed in to change notification settings - Fork 16.8k
[stable/minecraft] Should be a statefulset, not a deployment #21230
Comments
I'll have to defer to @gtaylor or @billimek for their advice, but it sounds like you have encountered a legitimate issue @TJM . FWIW, I have also found a StatefulSet (manually via kubectl apply) to be a nice way to manage my kube deploys of minecraft: https://gist.github.com/itzg/c7aeaeadc07585df1a814405f6774988 however, a Deployment with separate PVC has worked fine for me too. I think it is Helm getting in way more than anything with being too aggressive with swapping out resources rather than patching the 1-replica ReplicaSet/Deployment/StatefulSet pod template. |
There is a lot of history and controversy about Deployment vs StatefulSet for helm charts and some strong opinions on both sides. To work around this specific issue with multi-attached storage, we can solve it by changing the update strategy to I'm happy to work-up a quick PR to make this change. It should alleviate the immediate problem with upgrades and we can continue to talk though Deployment vs Statefulset. What do you think? |
That works for me @billimek . Yeah, I skimmed that issue about the Deployment vs StatefulSet and IMHO the choice is fairly arbitrary since both strategies in the general kubernetes-sence equally support persistent volumes. |
#21272 raised for this. |
I think changing the
I was also thinking that this may be the case, as I was trying to simply update an annotation (trying to use minecraft as a demo for velero backup). When the deployment is "patched" it seems to start new pods |
@itzg I think PVCs for deployments would usually be RWX (ReadWriteMany), like NFS. However, as per my error above, that would be bad for MC. As noted tho, using "Recreate" should make it safe with RWO (ReadWriteOnce) or block storage. |
I think we can all agree that workloads like minecraft or similar things should never leverage shared storage or multiple replicas accessing the same storage. Assuming this is a truth, it begs the question why not run as a statefulset which will, using defaults, protect against the above situation. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
I though this was resolved, or are we still on the fence as to whether to change from deployment/replicaset to statefulset? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions. |
This issue is being automatically closed due to inactivity. |
As per issue #1863 the storage is RWO, which means that a deployment is not good, it should be a statefulset.
Version of Helm and Kubernetes:
Which chart: stable/minecraft
What happened: upgrades (changing config) fails due to deployment trying to mount the storage twice.
What you expected to happen: It should stop the old pod, then start the new one. Apparently thats a statefulset?
How to reproduce it (as minimally and precisely as possible):
helm upgrade --install mc stable/minecraft --set eula=true
helm upgrade --install mc stable/minecraft -f values.yaml #(with other settings)
Anything else we need to know:
See #1863 for details
CC: @itzg
The text was updated successfully, but these errors were encountered: