Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.84 KB

pre-provisioned-pv.md

File metadata and controls

62 lines (42 loc) · 1.84 KB

Kubernetes Pre-Provisioned Filesore instance User Guide

This guide gives a simple example on how to use this driver with filestore instances that have been pre-provisioned by an administrator.

Pre-Provision a Filestore instance

If you have not already pre-provisioned a filestore instance on GCP you can do that now.

  1. Create a filestore instance following the instructions here

Create Persistent Volume for Filestore instance

  1. Create example Storage Class
kubectl apply -f ./examples/kubernetes/sc-latebind.yaml
  1. Create example Persistent Volume

Note: The volumeHandle should be updated based on the zone, Filestore instance name, and share name created. storage value should be generated based on the size of the underlying instance. VolumeAttributes ip must point to the filestore instance IP, and volume must point to the fileshare name.

kubectl apply -f ./examples/kubernetes/pre-provision/preprov-pv.yaml

Use Persistent Volume In Pod

  1. Create example PVC and Pod
$ kubectl apply -f ./examples/kubernetes/pre-provision/preprov-pod-demo.yaml
  1. Verify PV is created and bound to PVC
$ kubectl get pvc
NAME          STATUS   VOLUME      CAPACITY   ACCESS MODES   STORAGECLASS    AGE
preprov-pvc   Bound    my-pre-pv   1Ti        RWX            csi-filestore   76s
  1. Verify pod is created and in RUNNING state (it may take a few minutes to get to running state)
$ kubectl get pods
NAME           READY   STATUS    RESTARTS   AGE
web-server-1   1/1     Running   0          119s
  1. Verify contents of the mounted volume
kubectl exec web-server-1 -- ls /usr/share/nginx/html
lost+found