Skip to content

Persistent Volume

To create a corresponding persistent volume cluster resource for the network share that we created on the previous step, open the cloud-proxy-ui-pv.yaml file and adjust the name of the NFS server as appropriate for your environment.

apiVersion: v1
kind: PersistentVolume
metadata:
  name: cloud-proxy-ui
spec:
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  nfs:
    server: 192.168.10.10
    path: /data/cloud-proxy-ui
    readOnly: no

Then run the following command to create the persistent volume.

kubectl apply -f cloud-proxy-ui-pv.yaml --validate

The output of kubectl get pv command will show that the Persistent Volume was created successfully. Also note, that the output indicates the created persistent volume is not yet claimed (which is expected as we will claim it on the next step).

# kubectl get pv
NAME           CAPACITY ACCESS MODES RECLAIM POLICY STATUS    CLAIM STORAGECLASS REASON AGE
cloud-proxy-ui 10Gi     RWO          Retain         Available                           86s