Create PVCs using the ReadOnlyMany access mode
This guide provides steps for mounting a disk in the ReadOnlyMany(ROM) access mode. The in-tree Portworx driver for Kubernetes does not support creating PVCs with the ReadOnlyMany(ROM) access mode. To achieve this functionality, follow the steps below:
Create a
sharedv4volume. Note that you can access asharedv4volume from multiple pods at the same time. For details about creating asharedv4volume, refer to the Create sharedv4 PVCs page.Add a
persistentVolumeClaimsubsection to thevolumessection of your Pod, specifying the following fields and values:readOnly: with the
truevalueclaimName: with the name of the PVC you created in the step above
apiVersion: v1
kind: Pod
metadata:
name: pvpod
spec:
containers:
- name: test-container
image: gcr.io/google_containers/test-webserver
volumeMounts:
- name: test-vol
mountPath: /test-portworx-volume
volumes:
- name: test-vol
persistentVolumeClaim:
claimName: pvcsc001
readOnly: true