Top Banner
Docker Networking
30

Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Sep 13, 2018

Download

Documents

vodan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Docker Networking

Page 2: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 3: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 4: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 5: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 6: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 7: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 8: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 9: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 10: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 11: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 12: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 13: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 14: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 15: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 16: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 17: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 18: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Create NetWorkDocker network create -d bridge --subnet 10.1.0.0/24 qt-bridge

Page 19: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

CREATE NETWORK (contd..)

Page 20: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Create Containers in custom Bridgedocker run -dt --name c1 --network ps-bridge ubuntu sleep 1d

docker run -dt --name c2 --network ps-bridge ubuntu sleep 1d

Inspect network (docker network inspect ps-bridge)

Page 21: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Create Containers in custom Bridge

Page 22: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

NETWORK TOpoloGy For bridge

Page 23: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Test Ping other container (c1) from c2

Page 24: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 25: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 26: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 27: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 28: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm
Page 29: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

Steps FOr multi-host networkingInstall docker on two or more hosts

On the first machine execute “docker swarm init”

Execute docker swarm join in other hosts

Execute docker network ls and you should be able to see

ingress with DRIVER as overlay

Execute “docker node ls” to find out nodes

Note: Following ports should be open ====>

Page 30: Docker Networking - Quality Thought · Steps FOr multi-host networking Install docker on two or more hosts On the first machine execute “docker swarm init” Execute docker swarm

CREATION of overlay network“Docker network create -d overlay qt-over” to create network

Try executing “docker network ls” on other container you will

not see the qt-over as docker follows lazy approach

To see the qt-over start a container.

“docker service create --name qt-svc --network qt-over --

replicas 3 hello-world sleep 1d”

To see the status execute on host1 “docker service ps ps-svc”