aws-efs-csi-driver icon indicating copy to clipboard operation
aws-efs-csi-driver copied to clipboard

Mount options with PVC

Open sean-redmond opened this issue 3 years ago • 5 comments

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?

sean-redmond avatar Jan 07 '22 18:01 sean-redmond

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Apr 07 '22 19:04 k8s-triage-robot

/remove-lifecycle stale

universam1 avatar May 03 '22 09:05 universam1

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.

jonathanrainer avatar May 07 '22 07:05 jonathanrainer

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.

SpoddyCoder avatar Jun 26 '22 16:06 SpoddyCoder

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Sep 24 '22 17:09 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

k8s-triage-robot avatar Oct 24 '22 17:10 k8s-triage-robot

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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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 avatar Nov 23 '22 18:11 k8s-triage-robot

@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/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was 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

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.

k8s-ci-robot avatar Nov 23 '22 18:11 k8s-ci-robot