Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Docker as a Service
Swarm clustering and Cross-
container Networking
Venkata Nagesh Devarapalli
Consultant Lab Engineer - ...
Agenda
Docker as a Service on VMWare Private Cloud
Basic Cross-container Networking (bridge)
Why Clustering Docker Hosts ?...
Why Docker on Virtual Env?
Docker enables scalable consumer facing Applications
Enterprise applications continue to run on...
Docker as a Service
Docker as a Service - Demo
End user logs in to vRA Self-Service Portal
Walkthrough of Service Catalogue – Menu Card
Select...
Basic Cross-container Networking
(bridge)
Basic Cross-container Networking
(bridge)
Bridge Network
NGINX port 80 Exposed
to Host port 80
Basic Cross-container Networking
(bridge)
Docker 1.10.1 running on Ubuntu 14.04
Start httpd containers
docker run -itd -v ...
Use cases: Cross-container
Networking in Same Host (bridge)
Best suited for Test/Dev
Ideal to run POC’s
Simple to setup an...
Swarm Clustering
Advanced Cross-container
Networking (overlay)
Why Docker Cluster?
Cluster
Simple to Manage
Scalable
Resilient
Production Grade
What is Swarm?
Native Clustering for Docker
Standard docker API’s
Integrates with existing tools (Docker compose,UI,Client...
Swarm requirements
2 or more hosts with Docker installed
No location/platform dependencies
Linux Kernel 3.16 or later
KV S...
PhysicalHostNetwork
Advanced Cross-container
Networking(overlay) using Swarm
Overlay(VxLAN)Network
NGINX port 80 Exposed
t...
Setup consul &
Create single node Swarm cluster
Enable ip forwarding
echo “net.ipv4.ip_forward=1” >> /etc/sysctl.conf && s...
Scaling Swarm cluster
Spinup Docker hosts
Enable ip forwarding
echo “net.ipv4.ip_forward=1” >> /etc/sysctl.conf && sysctl ...
Create overlay network &
Verify Swarm Cluster
Pull a docker image on Swarm Cluster
docker -H tcp://{swarm_host}:4243 pull ...
Scale application on Swarm using
overlay network
Start additional httpd containers on Swarm cluster
docker $dc run -itd -v...
Summary
Docker as a Service Architecture
Docker host through self-service portal
Basic Cross-container Networking (bridge)...
dvnagesh@gmail.com
https://in.linkedin.com/in/dvnagesh
dvnagesh@gmail.com
https://in.linkedin.com/in/dvnagesh
Upcoming SlideShare
Loading in …5
×

Docker clustering meetup

Docker as a service and clustering using swarm.

  • Be the first to comment

Docker clustering meetup

  1. 1. Docker as a Service Swarm clustering and Cross- container Networking Venkata Nagesh Devarapalli Consultant Lab Engineer - EMC
  2. 2. Agenda Docker as a Service on VMWare Private Cloud Basic Cross-container Networking (bridge) Why Clustering Docker Hosts ? What is Swarm ? Swarm Requirements Advanced Cross-container Networking (Overlay) using Swarm
  3. 3. Why Docker on Virtual Env? Docker enables scalable consumer facing Applications Enterprise applications continue to run on traditional infrastructures Challenges IT to support both worlds Infrastructure silo’s increase costs, manageability Docker on Private cloud, protect investments Eliminate Infrastructure silo’s Enable developers with best of both worlds
  4. 4. Docker as a Service
  5. 5. Docker as a Service - Demo End user logs in to vRA Self-Service Portal Walkthrough of Service Catalogue – Menu Card Select Docker as a Service Simplicity and Flexibility of Service Provision a Docker Host Use Docker
  6. 6. Basic Cross-container Networking (bridge)
  7. 7. Basic Cross-container Networking (bridge) Bridge Network NGINX port 80 Exposed to Host port 80
  8. 8. Basic Cross-container Networking (bridge) Docker 1.10.1 running on Ubuntu 14.04 Start httpd containers docker run -itd -v /root/venkat/apps/web1/:/usr/local/apache2/htdocs/ --name=web1 httpd docker run -itd -v /root/venkat/apps/web2/:/usr/local/apache2/htdocs/ --name=web2 httpd docker run -itd -v /root/venkat/apps/web3/:/usr/local/apache2/htdocs/ --name=web3 httpd docker run -itd -v /root/venkat/apps/web4/:/usr/local/apache2/htdocs/ --name=web4 httpd docker run -itd -v /root/venkat/apps/web5/:/usr/local/apache2/htdocs/ --name=web5 httpd Start nginx container docker run -itd -v /root/venkat/apps/nginx/:/etc/nginx/ -p 80:80 --name=lb nginx Access webserver via nginx on host port 80
  9. 9. Use cases: Cross-container Networking in Same Host (bridge) Best suited for Test/Dev Ideal to run POC’s Simple to setup and use Can run multi tiered applications Expose ports only for user facing tier and not all tiers No High Availability Not Scalable
  10. 10. Swarm Clustering Advanced Cross-container Networking (overlay)
  11. 11. Why Docker Cluster? Cluster Simple to Manage Scalable Resilient Production Grade
  12. 12. What is Swarm? Native Clustering for Docker Standard docker API’s Integrates with existing tools (Docker compose,UI,Client etc..) Pool of docker hosts managed as single virtual docker host Scalable and Production ready (1K nodes, 50K containers tested) Flexible Container scheduling (node tags, spread, affinity etc..) Failover and HA for Swarm Manager (Primary and replicas) Integrated Networking and Volumes
  13. 13. Swarm requirements 2 or more hosts with Docker installed No location/platform dependencies Linux Kernel 3.16 or later KV Store for overlay network - Consul/etcd/Zookeeper Discovery service Swarm Manager Swarm Agents
  14. 14. PhysicalHostNetwork Advanced Cross-container Networking(overlay) using Swarm Overlay(VxLAN)Network NGINX port 80 Exposed to Host port 443
  15. 15. Setup consul & Create single node Swarm cluster Enable ip forwarding echo “net.ipv4.ip_forward=1” >> /etc/sysctl.conf && sysctl -p Setup and Verify Key-Value store – consul used for demo docker run -d -p 8500:8500 -h consul progrium/consul -server -bootstrap http://{docker_host}:8500 Join Host to Swarm and start Swarm Manager docker run -d swarm join --addr={docker_host}:2375 consul://{consul_host}:8500/nodes docker run -d -p 4243:2375 swarm manage consul://{consul_host}:8500/nodes List Swarm Cluster nodes docker run -i swarm l consul://{consul_host}:8500/nodes Test docker cli on Swarm Cluster docker -H tcp://{swarm_host}:4243 info
  16. 16. Scaling Swarm cluster Spinup Docker hosts Enable ip forwarding echo “net.ipv4.ip_forward=1” >> /etc/sysctl.conf && sysctl -p Enable discovery using consul Edit /etc/default/docker and update DOCKER_OPTS Restart docker daemon Join Hosts to Swarm cluster docker run -d swarm join --addr={docker_host}:2375 consul://{consul_host}:8500/nodes List Swarm Cluster nodes docker run -i swarm l consul://{consul_host}:8500/nodes Test docker cli on Swarm Cluster docker -H tcp://{swarm_host}:4243 info
  17. 17. Create overlay network & Verify Swarm Cluster Pull a docker image on Swarm Cluster docker -H tcp://{swarm_host}:4243 pull alpine Create overlay Network docker network create --driver overlay cluster-net Create configuration/content on hosts Start httpd container on Swarm cluster docker $dc run -itd -v /root/venkat/apps/web1/:/usr/local/apache2/htdocs/ --name=c-web1 --net=cluster-net httpd Start nginx container on Swarm cluster docker $dc run -itd -v /root/venkat/apps/cluster_nginx/:/etc/nginx/ -p 443:80 --name=c-lb --net=cluster-net nginx Access webserver via nginx on host port 443
  18. 18. Scale application on Swarm using overlay network Start additional httpd containers on Swarm cluster docker $dc run -itd -v /root/venkat/apps/web2/:/usr/local/apache2/htdocs/ --name=c-web2 --net=cluster-net httpd docker $dc run -itd -v /root/venkat/apps/web3/:/usr/local/apache2/htdocs/ --name=c-web3 --net=cluster-net httpd docker $dc run -itd -v /root/venkat/apps/web4/:/usr/local/apache2/htdocs/ --name=c-web4 --net=cluster-net httpd docker $dc run -e constraint:node=={docker_host} -itd -v /root/venkat/apps/web5/:/usr/local/apache2/htdocs/ --name=c-web5 -- net=cluster-net httpd Update nginx configuration and reload nginx service docker $dc exec service nginx reload c-lb Access webserver via nginx and verify load balancing Note the resource scheduling and container placement
  19. 19. Summary Docker as a Service Architecture Docker host through self-service portal Basic Cross-container Networking (bridge) Docker Swarm clustering Advanced Cross-container Networking (Overlay) using Swarm
  20. 20. dvnagesh@gmail.com https://in.linkedin.com/in/dvnagesh
  21. 21. dvnagesh@gmail.com https://in.linkedin.com/in/dvnagesh

×