Container deployment, scaling, and orchestration with Docker Swarm
You have installed Docker, you know how to run containers, you have written Dockerfiles to build container images for your applications (or parts of your applications), and perhaps your are even using Compose to describe your application stack as an assemblage of multiple containers.
But how do you go to production? What modifications are necessary in your code to allow it to run on a cluster? (Spoiler alert: very little, if at all.) How does one set up such a cluster, anyway? Then how can we use it to deploy and scale appications with high availability requirements? What about logging, metrics, and other production-related requirements?
In this workshop, we will answer those questions using tools from the Docker ecosystem, with a strong focus on the native orchestration capabilities available since Docker Engine 1.12, aka "Swarm Mode."
We will:
- build and run micro-services with Docker Compose
- identify bottlenecks and scale containers
- describe concepts and features of SwarmKit and Swarm Mode
- set up and manage a cluster with Swarm Mode
- operate of a local container registry
- deploy our micro-services app on Swarm
- configure and troubleshoot overlay networks
- perform rolling updates
- collect application logs (using ELK as an example)
- collect node and container metrics (using Intel Snap and Prometheus as an example)
- manage stateful services with Docker volumes
- simplify application life cycle using Compose features and Distributed Application Bundles
- script image life cycle using advanced Compose features
A similar tutorial was presented at SCALE14x in 2016. This tutorial is a vastly updated version taking into account the new, native orchestration features of Docker 1.12 (released later in 2016) and diving deeper into the operational aspects of Docker in production.
The audience will get a deep understanding of the Docker native orchestration abilities provided by SwarmKit, both in theory and in practice. During the tutorial, they will deploy the demo app on their own Docker cluster, gathering first-hand experience in the process.
All the examples (sample apps, tooling, scripts) shown in the tutorial are built to be simple (and understandable), yet practical (and therefore directly reusable in real world scenarios), and are available on a public GitHub repository.