On its own, a container lives on a single machine: if that machine fails, the container disappears with it, and starting it on another machine is a separate job. When there are dozens of containers spread across dozens of machines, watching over each one by hand is no longer workable — this is the job the orchestrator takes over.
What an orchestrator does
| Task | What the system does |
|---|---|
| Scheduling | decides which node to place each container on, taking into account free CPU and memory, service requirements and availability zones |
| Self-healing | restarts failed containers and moves them off dead nodes; the count is kept against the declared number of replicas |
| Scaling | adds and removes replicas according to load or to a set number |
| Updates | rolls out a new version in stages, with health checks; a failed release is rolled back |
| Networking and discovery | assigns addresses to containers, maintains internal names and balances traffic between replicas |
| Everything else | secrets and configuration, storage, resource limits |
Kubernetes, Nomad and Docker Swarm
There are several orchestrators, and they differ in design. Kubernetes is the most widespread: it is developed under the CNCF, its configuration is declared in YAML manifests, and a large ecosystem of tools has grown around it. Google open-sourced the project in 2014; by origin it goes back to Borg, Google’s internal cluster management system. Nomad from HashiCorp is a single binary that handles not only containers but also plain processes and other workloads. Docker Swarm is built right into the Docker engine and is driven by ordinary docker commands, though it is more modest in capabilities.
| System | Who maintains it | What it is known for |
|---|---|---|
| Kubernetes | CNCF; the project was open-sourced by Google in 2014 | the de facto standard: a declarative model, autoscaling, a wealth of extensions and tools |
| Nomad | HashiCorp | a single binary with no external services, a single scheduler for containers, processes and other workloads |
| Docker Swarm | Docker | swarm mode inside Docker Engine: the docker swarm and docker service commands |
Example: a Kubernetes manifest specifies replicas: 3 — three replicas of the service. The node hosting one of them dies: the controller notices that only two replicas are left and starts a third on another node — with no human involvement. This self-healing is a direct consequence of the declarative model: the system simply brings the state back to what was declared. Change the entry to replicas: 6, and three more replicas will come up.
Sources
the term is written from these pagesVerified 9 Nov