/nfs-server-proxy-operator

A Juju operator for proxying exported NFS shares.

Primary LanguagePythonApache License 2.0Apache-2.0

NFS server proxy operator

A Juju operator for proxying exported NFS shares.

Charmhub Badge CI Release Matrix

Features

The NFS server proxy operator enable NFS client operators to mount exported NFS shares on NFS servers not managed by Juju. This proxy operator enables Juju users to manually set an NFS share endpoint that their NFS client operators need to mount.

Usage

With a minimal NFS kernel server

First, launch a virtual machine using LXD:

$ snap install lxd
$ lxd init --auto
$ lxc launch ubuntu:22.04 nfs-server --vm
$ lxc shell nfs-server

Inside the LXD virtual machine, set up an NFS kernel server that exports a /data directory:

apt update && apt upgrade
apt install nfs-kernel-server
mkdir -p /data
cat << 'EOF' > /etc/exports
/srv     *(ro,sync,subtree_check)
/data    *(rw,sync,no_subtree_check,no_root_squash)
EOF
exportfs -a
systemctl restart nfs-kernel-server

You can verify if the NFS server is exporting the desired directories by using the command showmount -e localhost while inside LXD virtual machine.

Grab the network address of the LXD virtual machine and then exit the current shell session:

hostname -I
exit

Now deploy the NFS server proxy operator with an NFS client operator and principal charm:

$ juju deploy nfs-server-proxy kernel-server-proxy --config \
    endpoint=<IPv4 address of LXD virtual machine>:/data
$ juju deploy nfs-client data --config mountpoint=/data
$ juju deploy ubuntu --base ubuntu@22.04
$ juju integrate data:juju-info ubuntu:juju-info
$ juju integrate data:nfs-share kernel-server-proxy:nfs-share

Project & Community

The NFS server proxy operator is a project of the Ubuntu HPC community. It is an open source project that is welcome to community involvement, contributions, suggestions, fixes, and constructive feedback. Interested in being involved with the development of the NFS server proxy operator? Check out these links below:

License

The NFS server proxy operator is free software, distributed under the Apache Software License, version 2.0. See the LICENSE file for more information.