I have been trying to attach a PersistentVolume, backed by Cloud Filestore, to my Deployment in GKE Autopilot. The Filestore Instance is on the same network as the Autopilot cluster, though I am consistently receiving the following errors:
"Unable to attach or mount volumes: unmounted volumes=[prd-fileserver-tmp-dir-volume], unattached volumes=[kube-api-access-fk6zj prd-fileserver-tmp-dir-volume localssd]: timed out waiting for the condition"
And when I run kubectl describe pod [POD_NAME] on the cluster, I see this error in the output:
Output: mount.nfs: access denied by server while mounting 10.209.161.2:/prd-fileserver-tmp-dir-volume
Below are my YAML files:
Filestore-pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: prd-fileserver
spec:
capacity:
storage: 20Gi
accessModes:
- ReadWriteMany
nfs:
path: /prd_fs_share
server: [IP_ADDRESS]
Filestore-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: prd-fileserver-claim
spec:
accessModes:
- ReadWriteMany
storageClassName: ""
volumeName: prd-fileserver
resources:
requests:
storage: 20Gi
deployment.yaml
# This is how I am mounting the PVC
volumes:
- name: prd-fileserver-tmp-dir-volume
persistentVolumeClaim:
claimName: prd-fileserver-claim
readOnly: false
# Attaching to container
- mountPath: /mnt/disks/fileserver/tmp
name: prd-fileserver-tmp-dir-volume
When I run this same configuration in GKE standard environment, everything works fine. My question is: can you use Cloud Filestore in GKE Autopilot? I am not seeing anythingthat suggests you can't.
Accessing file shares from Google Kubernetes Engine clusters from the public docs doesn't mention that you need to run a Privileged Pod, but I see various articles online that mention you have to run a Privileged Pod in GKE to access Filestore. That would be a limitation for GKE Autopilot given you can't run Privileged Pods.