edit pvc from ReadWriteOnce to ReadWriteMany

5/28/2020

I have pvc with access policy

     accessModes:
      - ReadWriteOnce 

I want to change it to ReadWriteMany does it possible to edit pvc without deleting it?

I know I can create it with deleting it but I dont want to delete it.

I checked this answer but it didn't helped me. This is oppsite of my use case.

-- Sachin Arote
kubernetes

1 Answer

5/28/2020

I tried editing it using kubectl edit pvc <pvc_name> and this is the output of the error when submititng changes:

persistentvolumeclaims "task-pv-claim" was not valid:
spec: Forbidden: is immutable after creation except resources.requests for bound claims

This means you cannot edit claim after it has been created, either using kubectl edit nor kubectl patch.

-- acid_fuji
Source: StackOverflow