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

Allow NFS Export in Container Filesystem with overlay2 #43299

Open
rdlarkins opened this issue Feb 28, 2022 · 6 comments
Open

Allow NFS Export in Container Filesystem with overlay2 #43299

rdlarkins opened this issue Feb 28, 2022 · 6 comments
Labels
area/storage/overlay area/volumes kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. version/20.10

Comments

@rdlarkins
Copy link

Description
NFS Export is disabled in the container filesystem when the storage driver is overlay2. The option is set by docker when mounting the filesystem as at least in the past, there were issues with enabling the 'index' option, this was changed in this PR.

In a bit of testing I've done, it seems like at least the immediate issues previously triggered by enabling 'index' no longer occur with recent docker/ubuntu (Docker version 20.10.12, build e91ed57 running on Ubuntu 20.04.4 LTS with kernel 5.13.0-30-generic).

Using aufs as the storage driver does allow for this behavior, but as aufs support is deprecated in docker it would be better to support this with the main storage driver. A suggestion in the comments of the PR linked would be to add an option to enable both 'index' and 'nfs_export' from docker only in the case where you want export enabled for a container.

@rdlarkins
Copy link
Author

Code where index option is set to off:

@sungaok
Copy link

sungaok commented Apr 25, 2023

@rdlarkins
hi,
can these code work to run or test right now?
I want use this function right now.

@thaJeztah thaJeztah added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. area/volumes area/storage/overlay version/20.10 labels Jun 6, 2023
@CobraFlow
Copy link

CobraFlow commented Dec 2, 2023

Hi,
I have a requirement for nfs_export=on and index=on inside a docker container. I am building a PXE boot server.
I have a mounted volume(ext4) containing a 'virgin' root filesystem. I create a RW folder for each connected client using the virgin root as the lower and the upper for the client's persistence area.

...Host
mnt /dev/sda /mnt/storage


...Container
mkdir -p /mnt/storage/test/someos
mkdir -p /mnt/storage/test/upperX
mkdir -p /mnt/storage/test/workX
mkdir -p /mnt/storage/test/userX

mount  -t overlay overlay -o nfs_export=on,index=on \
    -o lowerdir=/mnt/storage/test/someos \
    -o upperdir=/mnt/storage/test/upperX \
    -o workdir=/mnt/storage/test/workX \
    /mnt/storage/test/userX

I then want to NFS export the resulting /mnt/storage/test/userX

@thaJeztah
Copy link
Member

@neersighted @dmcgowan could you have a peek?

@CobraFlow
Copy link

Has anyone 'peeked' at this yet? @neersighted @dmcgowan ... 🙏

@CobraFlow
Copy link

Has anyone had a look at this yet? I'm going to need a solution soon as I'm a bit stuck without this...🤔😳🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage/overlay area/volumes kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. version/20.10
Projects
None yet
Development

No branches or pull requests

4 participants