Set up an NFS Server

    Once your NFS server machine is ready, you can use KubeKey to install NFS-client Provisioner by Helm charts together with Kubernetes and KubeSphere. The exported directory of your NFS server must be provided in your Chart configurations used by KubeKey during installation.

    Note

    • You can also create the storage class of NFS-client after you install a KubeSphere cluster.
    • It is not recommended that you use NFS storage for production (especially on Kubernetes version 1.20 or later) as some issues may occur, such as and input/output error, resulting in Pod CrashLoopBackOff. Besides, some apps may not be compatible with NFS, including .

    This tutorial demonstrates how to install the NFS server on Ubuntu 16.04 as an example.

    To set up your server machine, you must install the NFS kernel server on it.

    1. Install the NFS kernel server.

      1. sudo apt install nfs-kernel-server

    Your NFS client will mount a directory on the server machine which has been exported by the NFS server.

    1. Run the following command to specify a mount folder name (for example, ).

      1. sudo mkdir -p /mnt/demo
    2. For demonstration purposes, remove restrictive permissions of the folder so that all your clients can access the directory.

      1. sudo chmod 777 /mnt/demo
      1. Add your client information to the file.

        If you have multiple client machines, you can add them all in the file. Alternatively, specify a subnet in the file so that all the clients within it can access the NFS server. For example:

        Note

        • rw: Read and write operations. The client machine will have both read and write access to the volume.
        • sync: Changes will be written to disk and memory.
        • no_subtree_check: Prevent subtree checking. It disables the security verification required for a client to mount permitted subdirectories.
      2. Save the file when you finish editing it.

        1. Restart the NFS kernel server.