...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
...
We will need to share the /dockerdata-nfs directory among all of the Kubernetes nodes.
Table of Contents |
---|
Create Volume
Here is an example of creating an OpenStack volume.
From an OpenStack UI, go to the Volumes tab and click the +Create Volume button to bring up the Create Volume page as shown below. Fill in the fields so that they match the screenshot below (choose your own Volume Name ):
The volume will be created as shown below:
Attach the Volume to the VM Instance
Underneath the Actions column, click on the down arrow beside Edit Volume to get a drop-down menu; select Manage Attachments:
The Manage Volume Attachments window will pop up:
Underneath Attach to Instance, click the down arrow beside Select an instance to get a drop-down menu; select the desired VM instance, then click on the Attach Volume button.
The volume will be attached to the desired VM instance with the Status changed to In-use, and the 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 the /dockdata-nfs directory:
(See more details at RedHat Enterprise Linux OpenStack Platform Getting Started Guide)
...
Find the volume id
...
ls /dev/disk/by-id
Expand | ||
---|---|---|
| ||
virtio-274e55f0-314f-4197-a |
...
Convert to mkfs format
...
sudo mkfs.ext4 /dev/disk/by-id/<volumeId>
Expand | ||
---|---|---|
| ||
ubuntu@sdnc-k8s:~/oom/kubernetes/config$ sudo mkfs.ext4 /dev/disk/by-id/virtio-274e55f0-314f-4197-a mke2fs 1.42.13 (17-May-2015) Creating filesystem with 26214400 4k blocks and 6553600 inodes Filesystem UUID: 8d9e10a2-c28b-4237-b1d5-69bf5c6bec6f Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000, 7962624, 11239424, 20480000, 23887872
Allocating group tables: done Writing inode tables: done Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done |
...
Mount the volume as the /dockerdata-nfs directory
...
sudo mkdir -p /dockerdata-nfs
sudo mount /dev/disk/by-id/virtio-274e55f0-314f-4197-a /dockerdata-nfs
...
Validate the mount
Expand | ||
---|---|---|
| ||
ubuntu@sdnc-k8s:~/oom/kubernetes/config$ df Filesystem 1K-blocks Used Available Use% Mounted on udev 8209144 0 8209144 0% /dev tmpfs 1643244 10832 1632412 1% /run /dev/vda1 20263528 5920744 14326400 30% / tmpfs 8216216 2244 8213972 1% /dev/shm tmpfs 5120 0 5120 0% /run/lock tmpfs 8216216 0 8216216 0% /sys/fs/cgroup tmpfs 1643244 0 1643244 0% /run/user/1000 /dev/vdb 103081248 61044 97760940 1% /dockerdata-nfs |
...
title | Example of using mount command to check the mount point |
---|
ubuntu@sdnc-k8s:~/oom/kubernetes/config$ mount|grep dockerdata
...
Tip |
---|
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.
Table of Contents |
---|
Create Volume
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.
...