Skip to content

Persistent Volume Claim

To claim the persistent volume we have created on the previous step, run the following command.

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

The claim looks like the following file and simply states that Admin UI needs at least 10 GB of storage on persistent volume.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: cloud-proxy-ui
spec:
  resources:
    requests:
      storage: 10Gi
  accessModes:
    - ReadWriteOnce
  storageClassName: ""

Now the output of the kubectl get pv command will show that all persistent volumes we have created on the previous step are claimed and thus available for Admin UI to use.

# kubectl get pv
NAME             CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM                    STORAGECLASS   REASON   AGE
cloud-proxy-ui   10Gi       RWO            Retain           Bound    default/cloud-proxy-ui                           4m50s

The claim itself can be viewed by running kubectl get pvc and will look like the following.

# kubectl get pvc
NAME             STATUS   VOLUME           CAPACITY   ACCESS MODES   STORAGECLASS   AGE
cloud-proxy-ui   Bound    cloud-proxy-ui   10Gi       RWO                           96s

Note the access mode of this claim is set to RWO meaning ReadWriteOnce so that only one cluster node can mount this volume as read-write. We are going to use this volume for storing logs, generating traffic statistics and storing configuration database so ensuring only one node is able to write to it is important.