Kubernetes CKA sample exam question 85 with answer

Question
Create a PersistentVolume by the name my-pv with storage 10Mi. Also configure appropriate access mode to Read multiple times.
Create a PersistentVolumeClaim by the name my-pvc and bind with the PersistentVolume created above.

Answer
There are three storage access modes: ReadWriteOnce, ReadWriteMany and ReadOnlyMany which are abbreviated as RWO, RWX and ROX, respectively.
As defined in the question, we have to set access mode to support multiple reads which means ReadOnlyMany is the correct choice.
Create following PV manifest:

apiVersion: v1
kind: PersistentVolume
metadata:
  name: my-pv
spec:
  capacity:
    storage: 10Mi
  accessModes:
  - ReadOnlyMany
  hostPath:
    path: "/mnt/persistent-volume"
And deploy the manifest using kubectl:
kubectl apply -f pv.yaml
Create following PVC manifest:
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
  - ReadOnlyMany
  resources:
    requests:
      storage: 10Mi
Deploy:
kubectl apply -f pvc.yaml
Verify:
kubectl get pv,pvc
the PVC should be in Bound state