mc-router icon indicating copy to clipboard operation
mc-router copied to clipboard

Auto Scale Up/Down with K8s Deployment

Open hugoallaine opened this issue 2 months ago • 4 comments

Hi there, is it possible to use auto scale feature with Minecraft server created by a Deployment? I guess no as I saw in the README.

Is it possible to add this feature? (I'm using rook-ceph as a storage controller and I think I don't really need StatefulSet. Correct me if I don't know something that would change my mind.)

hugoallaine avatar Nov 09 '25 18:11 hugoallaine

Very good question. Since it's only adjusting the replica count, then I think it could be enhanced to support Deployment type since it also derives from ReplicaSet.

I'll have to research the code some more.

itzg avatar Nov 09 '25 21:11 itzg

...ok, this might be tricky. StatefulSet has a serviceName field, which is leveraged by the auto scale feature.

With Deployment it's more indirect to find the association since

  • Deployment selects Pods
  • Service selects Pods

So I think it would take some type of logic to find the intersection of selected pods.

itzg avatar Nov 09 '25 21:11 itzg

@itzg I don't know how works the auto scale feature with StatefulSet but it is not simple has taking the selector label name of the service to get the statefulset corresponding and scaling up/down? I guess it's what it could be with Deployment but I don't know exactly what is the difference with StatefulSet.

hugoallaine avatar Nov 09 '25 21:11 hugoallaine

I explained it above.

itzg avatar Nov 09 '25 22:11 itzg