Configure MSR for NFS

You can configure your MSR replicas to store images on an NFS partition, to thus enable all replicas to share the same storage back end.

Before configuring MSR for NFS

  1. Verify that the NFS server has the correct configuration.

  2. Verify that the NFS server has a fixed IP address.

  3. Verify that all hosts that are running MSR have the correct NFS libraries.

  4. Verify that the hosts can connect to the NFS server by listing the directories exported by your NFS server:

    showmount -e <nfsserver>
    
  5. Mount one of the exported directories:

    mkdir /tmp/mydir && sudo mount -t nfs <nfs server>:<directory> /tmp/mydir
    

Install MSR with NFS

  1. Define the NFS service:

    kubectl create -f examples/staging/volumes/nfs/provisioner/nfs-server-gce-pv.yaml
    
  2. Create an NFS server and service:

    1. Create the NFS server from the service definition:

      kubectl create -f examples/staging/volumes/nfs/nfs-server-rc.yaml
      
    2. Expose the NFS server as a service:

      kubectl create -f examples/staging/volumes/nfs/nfs-server-service.yaml
      
    3. Verify that the Pods are correctly deployed:

      kubectl get pods -l role=nfs-server.
      
  3. Create the persistent volume claim:

    1. Locate the cluster IP for your server:

      kubectl describe services nfs-server
      
    2. Edit the NFS persistent volume to use the correct IP address. Because there are not yet any service names, you must hard-code the IP address.

  4. Set up the persistent volume to use the NFS service:

    kubectl create -f examples/staging/volumes/nfs/nfs-pv.yaml
    kubectl create -f examples/staging/volumes/nfs/nfs-pvc.yaml
    

Note

Switching MSR to NFS

As MSR does not migrate storage content when it switches back ends, you must migrate the content prior to changing the MSR storage configuration.