itzg / minecraft-server-charts

MIT License
279 stars 144 forks source link

Can't set `replicaCount` to 0 #195

Closed josephshanak closed 7 months ago

josephshanak commented 8 months ago

You are not able to set a replicaCount to 0. Doing so results in a 1 replica instead of 0 replicas. The use case is this is that I'd like to scale down the minecraft server while making other changes to the chart. However, when I apply the chart it keeps scaling it back to 1.

This is pretty easy to repro by running:

helm template   --set 'replicaCount=0' --set 'minecraftServer.eula=true' ./charts/minecraft | grep replicas

which returns

  replicas: 1

However using other values works:

helm template   --set 'replicaCount=3' --set 'minecraftServer.eula=true' ./charts/minecraft | grep replicas

returns

  replicas: 3

I believe this is caused by: https://github.com/helm/helm/issues/3164

That issue is attached to several work-around PRs, which may be helpful to resolve this.

josephshanak commented 8 months ago

A possible work-around is to set minecraftServer.eula to false. However, I think this would only work if you are using persistence.dataDir.existingClaim.

itzg commented 8 months ago

It would be great if someone submitted a PR for this.