PV PVC seems to be bound to a same Kubernetes node

12/17/2018

I have 3 Linux VM on my MBP, and all 3 VM can share the same disk on MBP's disk (I have no NFS). K8S can dispatch the docker images to K8S nodes. When I kill the process, it seems restarted on the same node. I am pretty the other node has the same docker image installed, and I guess it is limited by the .yaml file which binds to the same PVC and PV on that node.

If so, how I can configure my .yaml file especially for PV and PVC so when the process is killed, K8S can dispatch it from the one node (the process got killed) to the other node.

Thanks, Derek

-- Derek Ma
kubernetes
kubernetes-pvc

1 Answer

12/17/2018

I don't believe this is possible. When the PV is bound to a node, as that's where it exists; so if your pod has a PVC bound to that PV it will always be scheduled on that node.

You'd need to use a different provider, such as Ceph/RBD, in-order to maintain freedom of movement and PV/PVC's.

Maybe Rook.io would be something useful for you to experiment with :)

-- Rawkode
Source: StackOverflow