I have setup a GKE cluster anad enabled the FileStore CSI driver. I have created the below StorageClass, PersistentVolumeClaim and the Deployment configuration
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: filestore-sc
provisioner: filestore.csi.storage.gke.io
volumeBindingMode: Immediate
allowVolumeExpansion: true
parameters:
tier: standard
network: default
kubectl apply -f <storage-class>.yaml
filestore-sc filestore.csi.storage.gke.io Delete Immediate true 17m
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: fileserver
spec:
accessModes:
- ReadWriteMany
storageClassName: filestore-sc
resources:
requests:
storage: 1Ti
kubectl apply -f <pvc.yaml>
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE fileserver Bound pvc-214e64b5-a28c-4d30-9e23-ba08fbed1482 1Ti RWX filestore-sc 17m
apiVersion: apps/v1
kind: Deployment
metadata:
name: reader
spec:
replicas: 1
selector:
matchLabels:
app: reader
template:
metadata:
labels:
app: reader
spec:
containers:
- name: nginx
image: nginx:stable-alpine
ports:
- containerPort: 80
volumeMounts:
- name: fileserver
mountPath: /usr/share/nginx/html # the shared directory
readOnly: true
volumes:
- name: fileserver
persistentVolumeClaim:
claimName: fileserver
kubectl get pods
NAME READY STATUS RESTARTS AGE reader-5c9cf696f-clgkm 0/1 ContainerCreating 0 15m
kubectl describe po reader-5c9cf696f-clgkm
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 16m default-scheduler Successfully assigned default/reader-5c9cf696f-clgkm to gke-primary-general-effdaa23-xqqt
Warning FailedMount 13m (x6 over 14m) kubelet MountVolume.MountDevice failed for volume "pvc-214e64b5-a28c-4d30-9e23-ba08fbed1482" : rpc error: code = Aborted desc = An operation with the given volume key modeInstance/us-central1-a/pvc-214e64b5-a28c-4d30-9e23-ba08fbed1482/vol1 already exists.
--- Most likely a long process is still running to completion. Retrying.
Warning FailedMount 34s (x7 over 14m) kubelet Unable to attach or mount volumes: unmounted volumes=[fileserver], unattached volumes=[], failed to process volumes=[]: timed out waiting for the condition
Warning FailedMount 2s (x5 over 14m) kubelet MountVolume.MountDevice failed for volume "pvc-214e64b5-a28c-4d30-9e23-ba08fbed1482" : rpc error: code = DeadlineExceeded desc = context deadline exceeded
Where am I going wrong? I am following this guide Link