You can skip step if your kubernetes deployment in on a single VM or physical system.
When setting up a kubernetes cluster, the folder /dockerdata-nfs must be shared between all the kubernetes nodes. This folder is used as a volume by the onap pods to share data and so there can only be one copy.
On this page we will attempt to do this by setting up nfs server on the kubernetes master node and then mount the exported directory on each of kubernetes’ nodes.
These instruction where written using VMs create from a ubuntu-16.04-server-cloudimg-amd64-disk1 image.
Create OpenStack Volume
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.
Mount the Volume to Other VM Instances
Work in progress
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:
ubuntu@sdnc-k8s:~/oom/kubernetes/oneclick$ kubectl logs sdnc-dbhost-3029711096-w1szw -n onap-sdnc
[Entrypoint] MySQL Docker Image 5.6.38-1.1.2
chown: changing ownership of '/var/lib/mysql/': Operation not permitted
ubuntu@sdnc-k8s:~/oom/kubernetes/oneclick$ kubectl logs consul-agent-3312409084-3560z -n onap-consul
chown: /consul/config: Operation not permitted
ubuntu@sdnc-k8s:~/oom/kubernetes/oneclick$
# | 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 | sudo exportfs -rav |
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.
For example,
sudo umount -l /dockerdata-nfs