SlideShare a Scribd company logo
DOCKER NETWORKING
TIPS
Load Balance Options
Presenter’s Name: Sreenivas Makam
Associated Youtube video:
https://youtu.be/aQmPqrHleJU
About me
 Senior Engineering Manager at Cisco Systems Data Center group
 Author of “Mastering CoreOS” https://www.packtpub.com/networking-
and-servers/mastering-coreos/ )
 Docker Captain(https://www.docker.com/community/docker-captains )
 Blog: https://sreeninet.wordpress.com/
 Projects: https://github.com/smakam
 LinkedIn: https://in.linkedin.com/in/sreenivasmakam
 Twitter: @srmakam
What is Service Discovery?
 Allows micro services running as containers to discover each
other automatically.
 Components of Service Discovery
 Health check – Identify healthy service
 DNS – Maintain service name to IP mapping
 Load balancer uses Service discovery database.
 Standalone Service discovery software examples – Consul, etcd
Service Discovery in Docker
 Service discovery is provided by DNS server available in Docker
engine.
 For unmanaged containers, container name resolves to
container IP. Alias names can be also be used.
 For services using service IP(endpoint mode=vip), service name
resolves to service IP which in turn forwards the request to
containers. In this case, ipvs based L4 load balancing is done.
 For services using direct DNS(endpoint mode=dnsrr), service
name directly resolves to container IP. In this case, DNS round
robin load balancing is done.
 Service Discovery is network scoped. Only containers in same
network can discover each other.
L4 Load balancer does load balancing based on L3 and L4 fields.
L7 Load balancer uses URL fields to load balance.
Load balancer also supports advanced features like SSL/TLS
termination, Content based routing, Access control and
authorization, Rewrites and redirects, sticky session
Example Load balancers are nginx, haproxy, traefik, ELB in AWS.
What is Load balancing?
 For unmanaged containers, load balancing is done using simple round robin
load balancing. Using aliases, a single alias can load balance to multiple
unmanaged containers .
 Docker takes care of load balancing internal services to the containers
associated with the services.
 For services using service IP(endpoint mode=vip), ipvs and iptables are used to
load balance. This provides L4 based load balancing. Ipvs is Linux kernel load
balancing feature.
 For services using direct DNS(endpoint mode=dnsrr), DNS round robin
balancing is used.
 For services exposed externally, Docker uses routing mesh to expose the service
on all Swarm nodes. Routing mesh uses “ingress” network to connect all nodes.
 For HTTP based load balancing, HRM(HTTP Routing mesh) can be used. This is
supported only with Docker EE.
 Docker can also integrate with external load balancers like nginx, haproxy,
traefik as well as cloud load balancers like ELB.
Load balancing in Docker
Client
(smakam/myubuntu)
Web server
(instavote/vote)
Web server
(instavote/vote)
Swarm
LB
Service name
Container IP
Container IP
Internal Load balancer
Example: https://github.com/smakam/docker/tree/master/loadbalance/internal
Client
(smakam/myubuntu)
Service
name
DNS Service IP
IP tables +
IPVS
Web server
(instavote/vote)
Web server
(instavote/vote)
Internal Load balancer - Details
Example: https://github.com/smakam/docker/tree/master/loadbalance/internal
Ingress
Network
Web server
(instavote/vote)
Web server
(instavote/vote)
Swarm
LB
Service name
Container IP
Container IP
Host name/IP:
Port
Ingress Load balancer
Example: https://github.com/smakam/docker/tree/master/loadbalance/ingress
Sandbox IP
Host name/IP:
Port
Ingress sandbox IP tables +
IPVS
Web server
(instavote/vote)
Web server
(instavote/vote)
NAT
Ingress Load balancer - Details
Example: https://github.com/smakam/docker/tree/master/loadbalance/ingress
Nginx Proxy
LB
Web server
(instavote/vote)
Web server
(instavote/vote)
Swarm
LB
Service
name
Container IP
Container IPRedirect
Ingress +
Swarm LBHost name/IP:
Port
Proxy Load balancer
Example: https://github.com/smakam/docker/tree/master/loadbalance/proxy
Ingress +
Swarm LB
Web server
(nginx)
Web server
(instavote/vote)
Traefik/
UCP
LBRedirect
Host name/IP:
Port
Web server
(instavote/vote)
Web server
(nginx)
/web
/vote
“vote” service
“Web” service
L7 Load balancer
Example: https://github.com/smakam/docker/tree/master/loadbalance/traefik
References
 White paper on Docker networking
 HRM and UCP White paper
 Docker blogs by me
 Docker Networking – common
issues and troubleshooting techniques

More Related Content

What's hot (20)

PPT
Docker Multi Host Networking, Rachit Arora, IBM
Neependra Khare
 
PDF
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
Mike Goelzer
 
PDF
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
Ranjith Rajaram
 
PPTX
Docker Mentorweek beginner workshop notes
Sreenivas Makam
 
PDF
Deeper Dive in Docker Overlay Networks
Docker, Inc.
 
PPTX
CoreOS Overview and Current Status
Sreenivas Makam
 
PPTX
Docker Networking - Current Status and goals of Experimental Networking
Sreenivas Makam
 
PPTX
Libnetwork update at Moby summit June 2017
Docker, Inc.
 
PDF
Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...
Docker, Inc.
 
PDF
Docker serverless v1.0
Thomas Chacko
 
PDF
Unikernels: the rise of the library hypervisor in MirageOS
Docker, Inc.
 
PPTX
Devops in Networking
Sreenivas Makam
 
PDF
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Michelle Antebi
 
PDF
Driving containerd operations with gRPC
Docker, Inc.
 
PDF
Docker Online Meetup #22: Docker Networking
Docker, Inc.
 
PDF
Docker 1.12 networking deep dive
Madhu Venugopal
 
PDF
Docker network performance in the public cloud
Arjan Schaaf
 
PDF
What's New in Docker 1.12?
Ajeet Singh Raina
 
PDF
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 
PPTX
Docker Security Overview
Sreenivas Makam
 
Docker Multi Host Networking, Rachit Arora, IBM
Neependra Khare
 
What's New in Docker 1.12 (June 20, 2016) by Mike Goelzer & Andrea Luzzardi
Mike Goelzer
 
What should be PID 1 in a container ? by Ranjith Rajaram for #rootConf 2017
Ranjith Rajaram
 
Docker Mentorweek beginner workshop notes
Sreenivas Makam
 
Deeper Dive in Docker Overlay Networks
Docker, Inc.
 
CoreOS Overview and Current Status
Sreenivas Makam
 
Docker Networking - Current Status and goals of Experimental Networking
Sreenivas Makam
 
Libnetwork update at Moby summit June 2017
Docker, Inc.
 
Plug-ins: Building, Shipping, Storing, and Running - Nandhini Santhanam and T...
Docker, Inc.
 
Docker serverless v1.0
Thomas Chacko
 
Unikernels: the rise of the library hypervisor in MirageOS
Docker, Inc.
 
Devops in Networking
Sreenivas Makam
 
Docker Meetup: Docker Networking 1.11, by Madhu Venugopal
Michelle Antebi
 
Driving containerd operations with gRPC
Docker, Inc.
 
Docker Online Meetup #22: Docker Networking
Docker, Inc.
 
Docker 1.12 networking deep dive
Madhu Venugopal
 
Docker network performance in the public cloud
Arjan Schaaf
 
What's New in Docker 1.12?
Ajeet Singh Raina
 
Container Network Interface: Network Plugins for Kubernetes and beyond
KubeAcademy
 
Docker Security Overview
Sreenivas Makam
 

Similar to Docker Networking Tip - Load balancing options (20)

PDF
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Ajeet Singh Raina
 
PDF
Deep Dive into Docker Swarm Mode
Ajeet Singh Raina
 
PDF
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Ajeet Singh Raina
 
PDF
Docker Networking Deep Dive
Docker, Inc.
 
PDF
New Docker Features for Orchestration and Containers
Jeff Anderson
 
PDF
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
tdc-globalcode
 
PDF
Demystfying container-networking
Balasundaram Natarajan
 
PDF
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Docker, Inc.
 
PDF
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
Docker, Inc.
 
PDF
Load Balancing for Containers and Cloud Native Architecture
Chiradeep Vittal
 
PPTX
Lessons learned in reaching multi-host container networking
Tony Georgiev
 
PPTX
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
Guillaume Morini
 
PDF
Deep dive in container service discovery
Docker, Inc.
 
PDF
Loadbalancers: The fabric for your micro services
Chiradeep Vittal
 
PPTX
Nats meetup oct 2016 docker 112
Nirmal Mehta
 
PDF
Kubernetes Networking 101 kubecon EU 2022
ssuser1490e8
 
PPTX
DCUS17 : Docker networking deep dive
Madhu Venugopal
 
PDF
11thDockerMeetupSwitzerland
Michael Mueller
 
PPTX
Docker Networking & Swarm Mode Introduction
Phi Huynh
 
PPTX
Docker summit : Docker Networking Control-plane & Data-Plane
Madhu Venugopal
 
Service Discovery & Load-Balancing under Docker 1.12.0 @ Docker Meetup #22
Ajeet Singh Raina
 
Deep Dive into Docker Swarm Mode
Ajeet Singh Raina
 
Collabnix Online Webinar - Demystifying Docker & Kubernetes Networking by Bal...
Ajeet Singh Raina
 
Docker Networking Deep Dive
Docker, Inc.
 
New Docker Features for Orchestration and Containers
Jeff Anderson
 
TDC2017 | São Paulo - Trilha Containers How we figured out we had a SRE team ...
tdc-globalcode
 
Demystfying container-networking
Balasundaram Natarajan
 
Using Docker Swarm Mode to Deploy Service Without Loss by Dongluo Chen & Nish...
Docker, Inc.
 
What's New in Docker 1.12 by Mike Goelzer and Andrea Luzzardi
Docker, Inc.
 
Load Balancing for Containers and Cloud Native Architecture
Chiradeep Vittal
 
Lessons learned in reaching multi-host container networking
Tony Georgiev
 
DockerCon EU 2018 Workshop: Container Networking for Swarm and Kubernetes in ...
Guillaume Morini
 
Deep dive in container service discovery
Docker, Inc.
 
Loadbalancers: The fabric for your micro services
Chiradeep Vittal
 
Nats meetup oct 2016 docker 112
Nirmal Mehta
 
Kubernetes Networking 101 kubecon EU 2022
ssuser1490e8
 
DCUS17 : Docker networking deep dive
Madhu Venugopal
 
11thDockerMeetupSwitzerland
Michael Mueller
 
Docker Networking & Swarm Mode Introduction
Phi Huynh
 
Docker summit : Docker Networking Control-plane & Data-Plane
Madhu Venugopal
 
Ad

More from Sreenivas Makam (10)

PDF
GKE Tip Series - Usage Metering
Sreenivas Makam
 
PDF
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
Sreenivas Makam
 
PDF
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam
 
PDF
My kubernetes toolkit
Sreenivas Makam
 
PDF
Top 3 reasons why you should run your Enterprise workloads on GKE
Sreenivas Makam
 
PDF
How Kubernetes helps Devops
Sreenivas Makam
 
PDF
Deep dive into Kubernetes Networking
Sreenivas Makam
 
PPTX
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
PPTX
Container Monitoring with Sysdig
Sreenivas Makam
 
PPTX
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
GKE Tip Series - Usage Metering
Sreenivas Makam
 
GKE Tip Series how do i choose between gke standard, autopilot and cloud run
Sreenivas Makam
 
Kubernetes design principles, patterns and ecosystem
Sreenivas Makam
 
My kubernetes toolkit
Sreenivas Makam
 
Top 3 reasons why you should run your Enterprise workloads on GKE
Sreenivas Makam
 
How Kubernetes helps Devops
Sreenivas Makam
 
Deep dive into Kubernetes Networking
Sreenivas Makam
 
Service Discovery using etcd, Consul and Kubernetes
Sreenivas Makam
 
Container Monitoring with Sysdig
Sreenivas Makam
 
CI, CD with Docker, Jenkins and Tutum
Sreenivas Makam
 
Ad

Recently uploaded (20)

PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PDF
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
PPTX
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
Jak MŚP w Europie Środkowo-Wschodniej odnajdują się w świecie AI
dominikamizerska1
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
HCIP-Data Center Facility Deployment V2.0 Training Material (Without Remarks ...
mcastillo49
 
COMPARISON OF RASTER ANALYSIS TOOLS OF QGIS AND ARCGIS
Sharanya Sarkar
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
CIFDAQ Market Wrap for the week of 4th July 2025
CIFDAQ
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
From Code to Challenge: Crafting Skill-Based Games That Engage and Reward
aiyshauae
 

Docker Networking Tip - Load balancing options

  • 1. DOCKER NETWORKING TIPS Load Balance Options Presenter’s Name: Sreenivas Makam Associated Youtube video: https://youtu.be/aQmPqrHleJU
  • 2. About me  Senior Engineering Manager at Cisco Systems Data Center group  Author of “Mastering CoreOS” https://www.packtpub.com/networking- and-servers/mastering-coreos/ )  Docker Captain(https://www.docker.com/community/docker-captains )  Blog: https://sreeninet.wordpress.com/  Projects: https://github.com/smakam  LinkedIn: https://in.linkedin.com/in/sreenivasmakam  Twitter: @srmakam
  • 3. What is Service Discovery?  Allows micro services running as containers to discover each other automatically.  Components of Service Discovery  Health check – Identify healthy service  DNS – Maintain service name to IP mapping  Load balancer uses Service discovery database.  Standalone Service discovery software examples – Consul, etcd
  • 4. Service Discovery in Docker  Service discovery is provided by DNS server available in Docker engine.  For unmanaged containers, container name resolves to container IP. Alias names can be also be used.  For services using service IP(endpoint mode=vip), service name resolves to service IP which in turn forwards the request to containers. In this case, ipvs based L4 load balancing is done.  For services using direct DNS(endpoint mode=dnsrr), service name directly resolves to container IP. In this case, DNS round robin load balancing is done.  Service Discovery is network scoped. Only containers in same network can discover each other.
  • 5. L4 Load balancer does load balancing based on L3 and L4 fields. L7 Load balancer uses URL fields to load balance. Load balancer also supports advanced features like SSL/TLS termination, Content based routing, Access control and authorization, Rewrites and redirects, sticky session Example Load balancers are nginx, haproxy, traefik, ELB in AWS. What is Load balancing?
  • 6.  For unmanaged containers, load balancing is done using simple round robin load balancing. Using aliases, a single alias can load balance to multiple unmanaged containers .  Docker takes care of load balancing internal services to the containers associated with the services.  For services using service IP(endpoint mode=vip), ipvs and iptables are used to load balance. This provides L4 based load balancing. Ipvs is Linux kernel load balancing feature.  For services using direct DNS(endpoint mode=dnsrr), DNS round robin balancing is used.  For services exposed externally, Docker uses routing mesh to expose the service on all Swarm nodes. Routing mesh uses “ingress” network to connect all nodes.  For HTTP based load balancing, HRM(HTTP Routing mesh) can be used. This is supported only with Docker EE.  Docker can also integrate with external load balancers like nginx, haproxy, traefik as well as cloud load balancers like ELB. Load balancing in Docker
  • 7. Client (smakam/myubuntu) Web server (instavote/vote) Web server (instavote/vote) Swarm LB Service name Container IP Container IP Internal Load balancer Example: https://github.com/smakam/docker/tree/master/loadbalance/internal
  • 8. Client (smakam/myubuntu) Service name DNS Service IP IP tables + IPVS Web server (instavote/vote) Web server (instavote/vote) Internal Load balancer - Details Example: https://github.com/smakam/docker/tree/master/loadbalance/internal
  • 9. Ingress Network Web server (instavote/vote) Web server (instavote/vote) Swarm LB Service name Container IP Container IP Host name/IP: Port Ingress Load balancer Example: https://github.com/smakam/docker/tree/master/loadbalance/ingress
  • 10. Sandbox IP Host name/IP: Port Ingress sandbox IP tables + IPVS Web server (instavote/vote) Web server (instavote/vote) NAT Ingress Load balancer - Details Example: https://github.com/smakam/docker/tree/master/loadbalance/ingress
  • 11. Nginx Proxy LB Web server (instavote/vote) Web server (instavote/vote) Swarm LB Service name Container IP Container IPRedirect Ingress + Swarm LBHost name/IP: Port Proxy Load balancer Example: https://github.com/smakam/docker/tree/master/loadbalance/proxy
  • 12. Ingress + Swarm LB Web server (nginx) Web server (instavote/vote) Traefik/ UCP LBRedirect Host name/IP: Port Web server (instavote/vote) Web server (nginx) /web /vote “vote” service “Web” service L7 Load balancer Example: https://github.com/smakam/docker/tree/master/loadbalance/traefik
  • 13. References  White paper on Docker networking  HRM and UCP White paper  Docker blogs by me  Docker Networking – common issues and troubleshooting techniques