Home > Software engineering >  Safely unbind statefulset/my-pod-0 pvc without affecting the other replicas
Safely unbind statefulset/my-pod-0 pvc without affecting the other replicas

Time:06-26

I have a statefulset with 2 pods, running on separate dedicated nodes, each with its own pvc.

I need to perform some maintenance to the PVs assigned to each of the PVCs assigned to the statefulset's pods.

So far I've been able to scale down the statefulset to 1 replica, which brought offline statefulset/pod-1, this way I've been able to perform the maintenance task.

Now I need to perform the same task to statefulset/pod-0, without taking offline statefulset/pod-1.

What are my options? Remember, statefulset/pod-0's pv must be unmounted in order to start the maintenance task.

CodePudding user response:

I don't think that this is possible to achieve with one statefulset because of the Deployment and Scaling Guarantees a statefulset provides. To unmount the volume of a pod, you must shutdown/delete the pod first and before this can be done to a pod in a statefulset, "all of its successors must be completely shutdown."

My advice is to plan and communicate a maintenance window with the stakeholders of the application and scale down the statefulset entirely to apply the changes to the volume in your storage backends. Moving volumes across storage backends is not a task to perform on a regular basis, so I think it is reasonable to ask for a one-time maintenance to do so.

CodePudding user response:

...to move the cinder pv from one backend to another

With Cinder CSI you can perform a snapshot or clone the volume into a new PV and move to another.

  • Related