Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Change step to 2 right after create VM and before undercloud setting
Tip

You can skip this step if your Kubernetes cluster deployment is on a single VM.

...

On this page we will attempt to do this by setting up an NFS server on one of the Kubernetes master node VM and then mount the exported directory on each of the every other Kubernetes nodes' VMs. 

These instruction where written using VMs created from a ubuntu-16.04-server-cloudimg-amd64-disk1 image.

Table of Contents

...

Any user can be used to run the steps in this page, as all the commands are "sudo".


Table of Contents


On the NFS Server

The actual /dockerdata-nfs folder will live on the Kubernetes master node VM.   Create the directory as root on the Kubernetes master node VM.one of the Kubernetes nodes' VMs which will also be running the NFS server to export this folder.

Choose one VM, from the to-be-Kubernetes node VMs, to be the NFS server and execute the steps in this section on this VM. 

Set up the /dockerdata-nfs Folder

Choose one of the following to create the /dockerdata-nfs folder on this VM:

Use local directory

Run the following command as root:

Code Block
languagebash
sudo mkdir -p /dockerdata-nfs

...

Use separate volume

Following instruction from Create an OpenStack Volume

...

to:

  • create a OpenStack volume
  • attach the volume to the Kubernetes master node VM
  • mount the attached volume to directory /dockerdata-nfs on the Kubernetes master node VM

...

Setup the NFS Server and Export  /dockerdata-nfs Folder

Execute the following commands:

Code Block
languagebash
titlenfs server
sudo apt update
sudo apt  install nfs-kernel-server
sudo
mkdir /export
sudo mkdirvi /exportetc/dockerdata-nfsexports
sudo# chmodappend 777 /export
sudo chmod 777 /export/dockerdata-nfs

sudo vi /etc/exports
# append "the following
#  /dockerdata-nfs *(rw,no_root_squash,no_subtree_check)"

sudo vi /etc/fstab 
# append " the following
#  /home/ubuntu/dockerdata-nfs /dockerdata-nfs    none    bind  0  0"

sudo service nfs-kernel-server restart
Expand
titleAn example of validate NFS server running

$ ps -ef|grep nfs
root 2205 2 0 15:59 ? 00:00:00 [nfsiod]

...

root 2215 2 0 15:59 ? 00:00:00 [nfsv4.0-svc]
root 13756 2 0 18:19 ? 00:00:00 [nfsd4_callbacks]
root 13758 2 0 18:19 ? 00:00:00 [nfsd]
root 13759 2 0 18:19 ? 00:00:00 [nfsd]
root 13760 2 0 18:19 ? 00:00:00 [nfsd]
root 13761 2 0 18:19 ? 00:00:00 [nfsd]
root 13762 2 0 18:19 ? 00:00:00 [nfsd]
root 13763 2 0 18:19 ? 00:00:00 [nfsd]
root 13764 2 0 18:19 ? 00:00:00 [nfsd]
root 13765 2 0 18:19 ? 00:00:00 [nfsd]
ubuntu 13820 23326 0 18:19 pts/0 00:00:00 grep --color=auto nfs
$


On the Other VMs

Mount the /dockerdata-nfs Folder

On each of the other Kubernetes cluster node VMs, mount the /dockerdata-nfs folder that is being served from the Kubernetes master VMNFS server.  

Code Block
languagebash
titlemount nfs mount
sudo apt update
sudo apt install nfs-common 
sudo mkdir /dockerdata-nfs
sudo chmod 777 /dockerdata-nfs


# #OptionOption 1:
sudo mount -t nfs -o proto=tcp,port=2049 <host|IP of k8s master node vm>:/dockerdata-nfs /dockerdata-nfs   nfs    auto  0  0NFS server>:/dockerdata-nfs /dockerdata-nfs
sudo vi /etc/fstab
# append "the following
#  <host|IP of k8s master node vm>NFS server>:/dockerdata-nfs /dockerdata-nfs   nfs    auto  0  0"


# #OptionOption 2:
#  (verified on Ubuntu 16.04 AWS EC2 EBS volume)
sudo vi /etc/fstab
# append the following
# cdrancher.onap.info:/dockerdata-nfs /dockerdata-nfs   nfs    auto  0  0
sudo mount -a

Tips

unmount

Use the lazy (-l) option to force unmount the mount point.

...