Docker Swarm Visualizer

Setelah kemaren bahas Docker Swarm lab, kali ini kita akan coba Swarm Visualizer, semacam web GUI untuk melihat Swarm.

Lab kali ini masih lanjutan dari Lab Docker Swarm Cluster.

Install unzip

[email protected]:~$ sudo apt install unzip
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following package was automatically installed and is no longer required:
grub-pc-bin
Use 'sudo apt autoremove' to remove it.
Suggested packages:
zip
The following NEW packages will be installed:
unzip
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 167 kB of archives.
After this operation, 558 kB of additional disk space will be used.
Get:1 http://nova.clouds.archive.ubuntu.com/ubuntu bionic/main amd64 unzip amd64 6.0-21ubuntu1 [167 kB]
Fetched 167 kB in 2s (78.5 kB/s)
Selecting previously unselected package unzip.
(Reading database … 60376 files and directories currently installed.)
Preparing to unpack …/unzip_6.0-21ubuntu1_amd64.deb …
Unpacking unzip (6.0-21ubuntu1) …
Processing triggers for mime-support (3.60ubuntu1) …
Setting up unzip (6.0-21ubuntu1) …
Processing triggers for man-db (2.8.3-2ubuntu0.1) …

Setelah itu download docker swarm visualizer

[email protected]:~$ wget https://github.com/dockersamples/docker-swarm-visualizer/archive/master.zip

Kemudian extract

[email protected]:~$ unzip master.zip

Ubah nama directory menjadi dockersample

mv docker-swarm-visualizer-master dockersamples

Jalankan perintah docker

[email protected]:~$ docker run -it -d -p 5000:8080 -v /var/run/docker.sock:/var/run/docker.sock dockersamples/visualizer
Unable to find image 'dockersamples/visualizer:latest' locally
latest: Pulling from dockersamples/visualizer
cd784148e348: Pull complete
f6268ae5d1d7: Pull complete
97eb9028b14b: Pull complete
9975a7a2a3d1: Pull complete
ba903e5e6801: Pull complete
7f034edb1086: Pull complete
cd5dbf77b483: Pull complete
5e7311667ddb: Pull complete
687c1072bfcb: Pull complete
aa18e5d3472c: Pull complete
a3da1957bd6b: Pull complete
e42dbf1c67c4: Pull complete
5a18b01011d2: Pull complete
Digest: sha256:54d65cbcbff52ee7d789cd285fbe68f07a46e3419c8fcded437af4c616915c85
Status: Downloaded newer image for dockersamples/visualizer:latest
765b970ff0010e0956fb2bf002861a04a290f04ef3d6980afed31f2609b38b71

Sekarang kita akan coba membuat service nginx dengan 3 replika

[email protected]:~$ docker service create --name my-web1 --publish 8080:80 --replicas 3 nginx
xsvgsuh3nsxg2ogg1wbqptj9f
overall progress: 3 out of 3 tasks
1/3: running
2/3: running
3/3: running
verify: Service converged

Cek service nginx jalan

Sekarang buka web browser, untuk melihat Swarm Visualizer (pada lab kali ini menggunakan port 5000)

2 thoughts on “Docker Swarm Visualizer

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.