kubernetes change PVC from ReadWriteOnce to ReadWriteMany

6/2/2017

Is it possible to change an existing PVC to ReadWriteMany from ReadWriteOnce without recreating it? I have an existing database pod and the file system has become read only for some reason. I wanted to connect another pod to the PVC to look at it.

-- Martlark
kubernetes

1 Answer

6/2/2017

You can do so without changing the PVC. The Once in ReadWriteOnce is not about the number of Pods accessing the PVC but about the number of Nodes accessing it.

Create another Pod mounting the same PVC and set nodeSelector (use hostname) so it schedules on the same node where the PVC is mounted now.

Alternatively SSH into the node that has the PVC mounted already for the Pod. kubectl describe ... gives you the id you are looking for if you have many mounts.

-- Janos Lenart
Source: StackOverflow