Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

How To Set Mount Options For NFS-Client Provisioner #1008

Closed
jdmaguire opened this issue Oct 1, 2018 · 8 comments
Closed

How To Set Mount Options For NFS-Client Provisioner #1008

jdmaguire opened this issue Oct 1, 2018 · 8 comments
Labels
area/nfs-client lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@jdmaguire
Copy link

jdmaguire commented Oct 1, 2018

Hiya,

I'm working on kubernetes clusters with RHEL as the underlying OS. RHEL has NFS version 4.1 as the default mount option. Unfortunately, my NFS server only supports version 3.x and 4.0. Because of this, using the nfs-client-provisioner fails as it doesn't override the hosts' mount options. I can edit the /etc/nfsmount.conf on the hosts to get this to work but this isn't a very portable solution.

I can't see an option to configure nfs-client-provisioner to use custom mount options. Is there a way to set mount options, something like helm install --name simplyguy --set nfs.server=x.y.z.w --set nfs.path=/example --set *someProperty*="vers=4.0" stable/nfs-client-provisioner?

@wongma7
Copy link
Contributor

wongma7 commented Oct 1, 2018

mountOptions is a field on the StorageClass, if there is a way to configure it via helm that will be ideal, but I believe it can be edited after the StorageClass has been created as well

@jdmaguire
Copy link
Author

jdmaguire commented Oct 2, 2018

Hmm, tried that just now and it didn't work. Looking around, it seems the StorageClass's mount options are not being propagated (#629). Transitively, I see that connected to #828 that you worked on. I helm fetch'd version: 1.1.1 of the chart with appVersion 3.1.0 (apologies if the terminology is incorrect). I put this in the StorageClass template:

mountOptions:
  - "vers=4.0"

After helm install'ing the local chart, I do see the storage class with the proper fields but don't see the nfs-client-provisioner using it. For sanity, I tried other mutations like "nfsvers=4.0" and wacky ones like "-o vers=4.0".

@wongma7
Copy link
Contributor

wongma7 commented Oct 2, 2018

Oh, it is the provisioner that needs mountOptions. This is more complicated.

The problem is that it isn't possible to specify mountOptions for the provisioner here https://github.com/helm/charts/blob/master/stable/nfs-client-provisioner/templates/deployment.yaml#L45 without using a PV. You will need to replace the nfs: with a persistentvolumeclaim: and fill it with the name of a PVC bound to a PV like https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistent-volumes with spec.nfs.path=/example and spec.nfs.server=x.y.z.w, and the desired mountOptions. Then the provisioner will mount the NFS server with the mount options you want. Basically you must create a PVC and PV for the provisioner to use.

We can't just put mountOptions into the deployment template because for security reasons only StorageClasses and PersistentVolumes can dictate mount options

/area nfs-client

@piterciosus
Copy link

I am trying to use the nfs-client-provisioner inside a kubernetes cluster in AWS (EKS) and want to see if there is an example on how to enable TLS using kubectl to set the mount options for the communication between the containers and an EFS volume.

@jdmaguire
Copy link
Author

This can be closed now.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 30, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 29, 2019
@MrAmbiG
Copy link

MrAmbiG commented Jul 21, 2020

This just worked for me

mountOptions:
    - nfsvers=4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/nfs-client lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

6 participants