This guide gives a simple example on how to use this driver with filestore instances that have been pre-provisioned by an administrator.
If you have not already pre-provisioned a filestore instance on GCP you can do that now.
- Create a filestore instance following the instructions here
- Create example Storage Class
kubectl apply -f ./examples/kubernetes/sc-latebind.yaml
- 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
- Create example PVC and Pod
$ kubectl apply -f ./examples/kubernetes/pre-provision/preprov-pod-demo.yaml
- 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
- 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
- Verify contents of the mounted volume
kubectl exec web-server-1 -- ls /usr/share/nginx/html
lost+found