Lab 3.4: Volume Driver

eksekusi di node1

ssh-keygen
ssh-copy-id root@podX-doc2

1. SSH ke node2. Buat folder /share dan exit kembali (pastikan sudah bisa ssh password less di node2)

ssh -l student podX-doc2
sudo mkdir /share
sudo chmod 777 /share
exit

2. Instal plugin sshfs

sudo docker plugin install --grant-all-permissions vieux/sshfs
sudo docker plugin ls
sudo docker plugin disable [PLUDIN ID]
sudo docker plugin set vieux/sshfs sshkey.source=/root/.ssh/
sudo docker plugin enable [PLUDIN ID]
sudo docker plugin ls

3. Membuat volume dengan driver sshfs

sudo docker volume create --driver vieux/sshfs -o sshcmd=root@10.X.X.20:/share  -o allow_other sshvolume

4. Uji jalankan container dengan volume

sudo docker run -d --name=nginxtest-ssh -p 8090:80 -v sshvolume:/usr/share/nginx/html nginx:latest

5. Eksekusi di node1. [screenshot-3-4-5]

sudo docker ps
curl http://localhost:8090

6. Hapus semua container

Daftar Materi