Tip |
---|
You can skip step if your kubernetes deployment in on a single VM or physical system. |
...
These instruction where written using VMs create from a ubuntu-16.04-server-cloudimg-amd64-disk1 image.
Table of Contents |
---|
Create
...
NFS Server and export /dockerdata-nfs on Kubernetes master VM
The actual /dockerdata-nfs folder will live on the kubernetes master VM.
In our environment we provision an Openstack volume to allocate more space instead of instead of using the VM default backing store.
This is an optional and can be skipped. Create an Openstack Volume
The following script can be used to setup the NFS server on the kubernetes master VM
Code Block | ||||
---|---|---|---|---|
| ||||
sudo apt update
sudo apt install nfs-kernel-server
mkdir ~/dockerdata-nfs
sudo mkdir -p /export/dockerdata-nfs
sudo chmod 777 /export
sudo chmod 777 /export/dockerdata-nfs
sudo vi /etc/exports
# append "/export/dockerdata-nfs *(rw,no_root_squash,no_subtree_check)"
sudo mount --bind /home/ubuntu/dockerdata-nfs /export/dockerdata-nfs
sudo vi /etc/fstab
# append "/home/ubuntu/dockerdata-nfs /export/dockerdata-nfs none bind 0 0"
sudo service nfs-kernel-server restart |
Mount the Volume to Other VM Instances
Warning | ||
---|---|---|
| ||
More investigatio needed (as part of multi-nodes kubernetes cluser) as I'm having "Operation not permitted" error in sdnc-dbhost pod when deploying SDN-C cluster with the mounted /dockerdata-nfs from this instruction:
|
...
# | Purpose | Command and Example | |||||
---|---|---|---|---|---|---|---|
1 | On the server of the attached VM instance | ||||||
1.1 | Install exportfs | if exportfs is not installed, install it with the following command:
| |||||
1.2 | Modify /etc/exports file to export the /dockerdata-nfs mount point |
| |||||
1.3 | Export the /dockerdata-nfs mount point | ||||||
2 | On the server of the other VM instance | ||||||
2.1 | Install nfs-common | sudo apt install nfs-common | |||||
2.2 | Mount the volume as the /dockerdata-nfs directory | sudo mkdir -p /dockerdata-nfs sudo mount <mount point server IP>:/dockerdata-nfs /dockerdata-nfs | |||||
2.3 | Validate the mount |
|
Tips
unmount
Use the lazy (-l) option to force unmount the mount point.
...