openchami-wiki/Use Cases/Serving the Root Filesystem with NFS (import-image.sh).md

858 B

For the tutorial, we served images via HTTP with a local S3 bucket using MinIO and an OCI registry. We could instead serve our images by network mounting the directories that hold our images with NFS. We can spin up a NFS server on the head node by including NFS tools in our base image and configure our nodes to mount the images.

Configure NFS to serve your SquashFS nfsroot with as much performance as possible.

sudo mkdir -p /opt/nfsroot && sudo chown rocky /opt/nfsroot

Create a file at path /etc/exports and copy the following contents to export the /opt/nfsroot directory for use by our compute nodes.

/opt/nfsroot *(ro,no_root_squash,no_subtree_check,noatime,async,fsid=0)

Reload the NFS daemon to apply the changes.

modprobe -r nfsd && modprobe nfsd