aws-efs-csi-driver
aws-efs-csi-driver copied to clipboard
Mount options with PVC
I am trying to set the client side mount option async as follows in the StorageClass
mountOptions:
- async
However this does not seem to get passed to the pod mount options:
# mount | grep efs
127.0.0.1:/ on /var/opt/efs type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,port=20270,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1)
Should this be supported? Is this the correct location to set the mount option?
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
/remove-lifecycle stale
Had a look into this on my own EKS Cluster, I set it up with the latest chart (2.2.6) running 1.3.8 of the software, and I turned up the logging verbosity on the efs-csi-node pods to level 5. I then put a storageClass into the cluster that had async in the mount options and observed the following:
I0507 06:53:48.184464 1 node.go:172] NodePublishVolume: creating dir /var/lib/kubelet/pods/825114ed-e131-4181-b20d-065b34b7ab7a/volumes/kubernetes.io~csi/pvc-75112856-fac6-4212-b1c0-87fa28c533dc/mount
I0507 06:53:48.184517 1 node.go:177] NodePublishVolume: mounting fs-08bf9da563ea97636:/ at /var/lib/kubelet/pods/825114ed-e131-4181-b20d-065b34b7ab7a/volumes/kubernetes.io~csi/pvc-75112856-fac6-4212-b1c0-87fa28c533dc/mount with options [accesspoint=fsap-0948f2b1d266285ac tls async]
I0507 06:53:48.489707 1 node.go:182] NodePublishVolume: /var/lib/kubelet/pods/825114ed-e131-4181-b20d-065b34b7ab7a/volumes/kubernetes.io~csi/pvc-75112856-fac6-4212-b1c0-87fa28c533dc/mount was mounted
So the option is being passed into the mount command that the driver is making. Now if you then log into the pod and run mount to list the mounts you see the following
$ mount
....
127.0.0.1:/ on /data type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,port=20226,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1)
....
Which doesn't show the async option there, which is a bit confusing. However as this forum post explains: https://bbs.archlinux.org/viewtopic.php?id=203824
Some default options, such as async, suid, dev, exec, auto, and nouser do not show up listing mounted filesystems (either with "mount" or "cat /proc/mounts"). I suppose they are assumed to be in effect when their opposite option is absent. That is, if you use sync, nosuid, nodev, or noexec options, you will see those listed.
And this is indeed true, if you re-run the same experiment and select sync instead of async that does show up as follows
$ mount
....
127.0.0.1:/ on /data type nfs4 (rw,sync,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,port=20186,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1)
....
So it seems that async is effectively a default and the driver is doing the right thing with mountOptions in the broader context it's just a bit of a peculiarity of the way mount works that you don't see the option even though it is very definitely being applied.
I've been unable to get fsc mount option to work when specifying at the StorageClass level...
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
name: efs-sc
provisioner: efs.csi.aws.com
mountOptions:
- fsc
The resulting mount in the pod does not have the option applied...
mount | grep myapp
127.0.0.1:/sites/myapp on /var/www/html type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,port=20448,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,local_lock=none,addr=127.0.0.1)
Moving the mount option to the PV instead...
apiVersion: v1
kind: PersistentVolume
metadata:
name: myapp-pv
namespace: myapp
spec:
mountOptions:
- fsc
Works, the pod mount shows the option being applied...
mount | grep myapp
127.0.0.1:/sites/myapp on /var/www/html type nfs4 (rw,relatime,vers=4.1,rsize=1048576,wsize=1048576,namlen=255,hard,noresvport,proto=tcp,port=20248,timeo=600,retrans=2,sec=sys,clientaddr=127.0.0.1,fsc,local_lock=none,addr=127.0.0.1)
This is on a 1.24.1 cluster. The fsc mount option is used for cachfilesd support - which can help with EFS drives with low throughput capacity.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle stale - Mark this issue or PR as rotten with
/lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues and PRs according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Mark this issue or PR as fresh with
/remove-lifecycle rotten - Close this issue or PR with
/close - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied - After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied - After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closed
You can:
- Reopen this issue with
/reopen - Mark this issue as fresh with
/remove-lifecycle rotten - Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
In response to this:
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
- After 90d of inactivity,
lifecycle/staleis applied- After 30d of inactivity since
lifecycle/stalewas applied,lifecycle/rottenis applied- After 30d of inactivity since
lifecycle/rottenwas applied, the issue is closedYou can:
- Reopen this issue with
/reopen- Mark this issue as fresh with
/remove-lifecycle rotten- Offer to help out with Issue Triage
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.