<p>I have a cassandra stateful workload, and I would like to migrate it to a new node pool in the same GKE cluster. The persistent volume of each cassandra pod is backed by a GCEPersistentDisk resource.</p>

<p>During workload(i.e. cassandra pods) migration, what would happen to its underlying persistent volume? Will the underlying persistent volume get automatically moved to the new node as well? I'm assuming that each persistent volume(or GCEPersistentDisk resource) is bound to a GKE node.</p>

<p>Besides the regular migration commands(e.g. cordon old nodes, drain old nodes that run cassandra pods), are there any extra commands I should run to make sure that "data is not lost" during this pod migration?</p>

twimo
<p>Short answer: The GCEPersistentDisks will move with your Cassandra pods.</p>

<p>So when a pod moves from one node to another, its GCEPersistentDisk is detached from the current node and then when it's scheduled on another node Kubernetes re-attaches it to that new node.</p>

<p>In the event that your current node is shut down abruptly, the GCEPersistentDisk will be released (detached) and eventually Kubernetes will schedule your workload on a new node and re-attach the disk. This is assuming that on your cloud provider you don't have selected the option of with the functionality relating to deleting the volume when the instance is terminated.</p>

<p>In summary, it should all work seamlessly given that Kubernetes talks to the cloud providers. More information <a href="https://github.com/kubernetes/kubernetes/tree/master/pkg/cloudprovider" rel="nofollow noreferrer">here</a>. Note that this is being deprecated in favor of the <a href="https://kubernetes.io/docs/tasks/administer-cluster/running-cloud-controller/" rel="nofollow noreferrer">Kubernetes Cloud Controller Manager</a></p>
