You can skip this step if you are not intended to do kubernetes clustering on more than one node.
As we will need to share the /dockerdata-nfs directory among all the kubernetes nodes.
Create Volume
Here is an example of creating openstack volume.
From openstack UI, go to Volumes tab, and click +Create Volume button to bring up the Create Volume page as the following, fill in the fields according to the screen shot (choose your own Volume Name )
The volume will be created as the following:
Attach the volume to the VM instance
From the volume column, click on the down arrow of Edit Volume to get drop down menu, and select Manage Attachments:
The Manage Volume Attachments window will pop up.
Click the down arrow of Select an instance of Attach To Instance field, to bring out the drop down menu, select the desired VM instance, then click on Attach Volume button.
The volume will be attached to the desired VM instance with Statue changed to In-use, and Attached To field updated.
The following is an example:
Mount the volume in the attached VM instance
On the attached VM instance server, follow the steps below to mount the volume as /dockdata-nfs directory:
(See more details at RedHat Enterprise Linux OpenStack Platform Getting Started Guide)
# | Purpose | Command and Example |
---|---|---|
1 | Find the volume id | ls /dev/disk/by-id |
2 | Conver to mkfs format | sudo mkfs.ext4 /dev/disk/by-id/<volumeId> |
3 | Mount volume as /dockerdata-nfs directory | sudo mkdir -p /dockerdata-nfs sudo mount /dev/disk/by-id/virtio-274e55f0-314f-4197-a /dockerdata-nfs |
4 | Validate the mount |
Mount the volume to other VM instance
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 /dockerdata-nfs mount point | |
1.3 | Export /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 volume as /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 lazy (-l) option to force unmount the mount point.
For example,
sudo umount -l /dockerdata-nfs