Tip |
---|
You can skip this step if your Kubernetes deployment is on a single VM or physical system. |
When setting up a k8s Kubernetes cluster, the folder /dockerdata-nfs must be shared between all of the k8s Kubernetes nodes. This This folder is used as a volume by the onap 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 a nfs an NFS server on the k8s Kubernetes master node vm VM and then mount the exported directory on each of the k8s’ the Kubernetes nodes' VMs.
These instruction where written using VMs create created from a ubuntu-16.04-server-cloudimg-amd64-disk1 image.
Table of Contents |
---|
Create NFS Server and export /dockerdata-nfs on Kubernetes master node VM
The actual /dockerdata-nfs folder will live on the k8s Kubernetes master node VM.
Create the directory as root on the k8s master the Kubernetes master node VM.
Code Block | ||
---|---|---|
| ||
sudo mkdir -p /export/dockerdata-nfs |
In our environment, we provision the dockerdata-nfs folder as a Openstack an OpenStack volume and used use that as the VM default backing store. This is optional and can be skipped. See Create an OpenStack Volume for details.
Setup the NFS server on the k8s master the Kubernetes master node VM and export the dockerdata-nfs folder:
Code Block | ||||
---|---|---|---|---|
| ||||
sudo apt update sudo apt install nfs-kernel-server 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 vi /etc/fstab # append "/home/ubuntu/dockerdata-nfs /export/dockerdata-nfs none bind 0 0" sudo service nfs-kernel-server restart |
...
Mount the dockerdata-nfs folder on each of the kubernetes Kubernetes node VMs.
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:
|
On each of the k8s node vm' Kubernetes node VMs, mount the /dockerdata-nfs folder that is being served from the k8s master Kubernetes master VM.
Code Block | ||||
---|---|---|---|---|
| ||||
sudo apt install nfs-common sudo mkdir /dockerdata-nfs sudo chmod 777 /dockerdata-nfs sudo mount -t nfs -o proto=tcp,port=2049 k8s-master:/export/dockerdata-nfs /dockerdata-nfs sudo vi /etc/fstab # append "<host|IP of k8s master node vm>:/export/dockerdata-nfs /dockerdata-nfs nfs auto 0 0" |
...