Stop one pod of a statefulset

299 Views Asked by At

On my kubernetes (hosted on Azure), I have a Statefulset named database with a replica = 3 to handle my database cluster (so I have pods database-0, database-1, database-2)

I have some operations to perform on the disk of one of the 'cluster node'. I Would like to shutdown database-1 (without stopping the two other pods), to be able to make changes to the disk mounted on a different pod, and then restart database-1.

How could I do that ? Is it even possible in kubernetes ?

Thanks

1

There are 1 best solutions below

0
Raghu On

What you want is no possible with statefulset controller. As the replica is 3 if you delete a specific pod, then the controller will bring back the pod. If you scale down the stateful set then the pods are terminated based on how much you scale down.