Deploy Network File System (NFS) Server

Steps to deploy NFS server on Rancher

Overview

This page provides a detailed guide for deploying an NFS (Network File System) server on Rancher. Follow the steps below to set up and configure the NFS server, and ensure it integrates smoothly with your Rancher environment.

Pre-requisites

Before starting with the deployment and configuration of the NFS (Network File System) server on Rancher, ensure the following prerequisites are met:

  1. Rancher Cluster: Ensure you have an operational Rancher User Management cluster specified here.

  2. Access to a Server: A server (EC2 instance or similar) that will host the NFS server, with root or sudo privileges.

  3. Network Configuration: Ensure the server and the Rancher cluster can communicate over the network. Specifically, ensure the NFS server security group allows traffic on TCP port 2049.

  4. Disk for NFS Share: A dedicated disk available on the server for use as the NFS share.

  5. Installed CLI Tools: Ensure the following CLI tools are installed and accessible:

    • yum (or another package manager if using a different OS)

  6. Service Account: Ensure the nfs-client-provisioner service account is created in your Rancher cluster.

  7. NFS Utilities: Ensure NFS utilities can be installed on the server.

  8. NFS Common: Ensure the NFS Common Library is installed on the worker nodes of Rancher.

Ensure that all these prerequisites are met before proceeding with the deployment steps.

Steps

The steps below provide a comprehensive guide for deploying and configuring an NFS server on Rancher, ensuring proper integration for seamless operation.

1

Install NFS Utilities

Log in to your server and switch to the root user:

Install the necessary NFS utilities:

Ensure the installation was successful:

2

Enable and Start NFS Services

Enable and start the rpcbind and nfs-server services:

3

Create the NFS Share Directory

Create the directory that will be shared via NFS:

4

Prepare the Disk for NFS

Identify and format the disk to be used for the NFS share:

Example output of formatting:

5

Verify and repair the filesystem

Check for any hardware errors related to the device:

If necessary, check and repair the filesystem:

6

Configure NFS Exports

Edit the /etc/exports file to export the /nfs-share directory:

Add the following line:

Export the directory:

Verify the export:

Example output:

7

Update NFS Server Security Group

Update the NFS server security group to allow TCP port 2049.

8

Apply the NFS-Common Library on Rancher Worker Nodes

Install the NFS Common Library on Rancher Worker Nodes to enable nfs utilities on worker nodes as well.

This DaemonSet ensures the nfs common library is installed on all Kubernetes worker nodes and works on Ubuntu worker nodes only.

9

Apply NFS Manifest

Apply the NFS manifest to your Rancher cluster. While applying the manifest, don’t forget to update with the private IP of your NFS server in the last section of the manifest.

10

Check for the NFS storage class creation

kubectl get storageclass

Last updated

Was this helpful?