1

How I will be able to change the access mode in the persistent volume claim access mode? currently it is showing as RWO, and I need to change it as RWX?

Many thanks in advance.

Graham Dumpleton
  • 57,726
  • 6
  • 119
  • 134
Anuradha Fernando
  • 1,063
  • 12
  • 17

3 Answers3

5

accessModes in PersistenceVolumeClaim (PVC) is an immutable field and cannot be changed once applied. Even though you can change the bounded PersistentVolume (PV) accessModes using the same way as suggested by @aurelius which will automatically updated PVC accessModes

Yatharth7
  • 135
  • 1
  • 10
1

There are three types of access modes supported in kubernetes

  1. RWO - ReadWriteOnce
  2. ROX - ReadOnlyMany
  3. RWX - ReadWriteMany

You should be updating the access mode in PersistentVolume as shown below

    accessModes:
      - ReadWriteMany
P Ekambaram
  • 15,499
  • 7
  • 34
  • 59
1

As an addition to P Ekambaram, you can do it using this commands:

*Note that this is instruction for Kubernetes, but I don't think it should be any different in OpenShift - looking at the OpenShift documentation you might need to replace kubectl with oc.

kubectl get PV

NAME         CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS    REASON   AGE
my_pv          50Gi       RWX            Delete           Available           local-storage            2d22h

kubectl edit pv my_pv

And change to desired access mode:

accessModes: - ReadWriteMany

You can edit most of the Kubernetes Objects in similar way.

aurelius
  • 3,433
  • 1
  • 13
  • 22