Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic multiple shared directories #37

Open
g0blin79 opened this issue Nov 15, 2019 · 2 comments
Open

Dynamic multiple shared directories #37

g0blin79 opened this issue Nov 15, 2019 · 2 comments

Comments

@g0blin79
Copy link

Feature Request

As specified in the README file, if you want to share more than two directories, you need to add a code snippet in nfsd.sh file, one for each directory you want to share other than first two.

This couldn't be enough in some specific situation, as (for example) if you want to use this docker image as NFS Server in a Google Kubernetes Engine, where using NFS fs is the only (cheeper) way to mount a volume in more than a container replica with ReadWriteMany access type.

Could be useful to handle multiple shared directories dynamically directly in this docker image, avoiding users to create their own Dockerfile.

My proposal is to create a specific environment variables for additional directories other than the first one. Basically, the main shared directory is the most important one, because all other have to be its subdirectories.

For example:

  • SHARED_DIRECTORY environment allows user to declare the main shared directory (ex: /exports)
  • EXTRA_SHARED_DIRECTORY_* environment, instead, should allow user to declare incremental extra shared directories (ex: /exports/mysql-datafile).

Then, in nfsd.sh, you can fetch all environment variables starting with EXTRA_SHARED_DIRECTORY_*, and spool them into /etc/exports file.

@g0blin79
Copy link
Author

Pull request: #38

@colearendt
Copy link

colearendt commented Aug 10, 2022

Worth discussing whether #38 (using several env vars) or #23 (using / parsing the command) is preferable

A benefit of separate env vars may be potential separate NFS_OPTS per mount 🤷 (Although the PR did not implement this pattern).

A benefit of the command is that the interface / command calling should be easier / simpler / shorter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants