Enter the following command:
Enter the command below, which sets the directory used for storage, along with user access rights. Modify the command if you’d like to keep storage at a different directory.
- The
-p /nfs
parameter creates a directory namednfs
at root. - The parameter allows all access to the storage directory.
- The
Create an NFS exports table. This table sets the directory paths on your NFS server that are exposed to the nodes that will use the server for storage.
- Open
/etc/exports
using your text editor of choice. Add the path of the
/nfs
folder that you created in step 3, along with the IP addresses of your cluster nodes. Add an entry for each IP address in your cluster. Follow each address and its accompanying parameters with a single space that is a delimiter.
- Open
Open the ports used by NFS.
To find out what ports NFS is using, enter the following command:
that the previous command outputs. For example, the following command opens port 2049:
sudo ufw allow 2049
Within Rancher, add the NFS server as a storage volume and/or storage class. After adding the server, you can use it for storage for your deployments.