Part 3

Multi-host environments

Now that we've mastered containers in small systems with docker-compose it's time to look beyond what the tools we practiced are capable of. In situations where we have more than a single host machine we cannot use docker-compose solely. However, Docker does contain other tools to help us with automatic deployment, scaling and management of dockerized applications.

In the scope of this course, we cannot go into how to use the tools in this section, but leaving them out would be a disservice.

Docker swarm mode is built into docker. It turns a pool of Docker hosts into a single virtual host. You can read the feature highlights here. You can run right away with docker swarm. Docker swarm mode is the lightest way of utilizing multiple hosts.

Docker Swarm (not to be confused with swarm mode) is a separate product for container orchestration on multiple hosts. It and other enterprise features were separated from Docker and sold to Mirantis late 2019. Initially, Mirantis announced that support for Docker Swarm would stop after two years. However, in the months thereafter they decided to continue supporting and developing Docker Swarm without a definitive end-date. Read more here.

Kubernetes is the de facto way of orchestrating your containers in large multi-host environments. The reason being it's customizability, large community and robust features. However the drawback is the higher learning curve compared to Docker swarms. You can read their introduction here.

The main difference you should take is that the tools are at their best in different situations. In a 2-3 host environment for a hobby project the gains from Kubernetes might not be as large compared to a environment where you need to orchestrate hundreds of hosts with multiple containers each.

You can get to know Kubernetes with k3s a lightweight Kubernetes distribution which you can run inside containers with k3d. This is a great way to get started as you don't have to worry about any credit limits.

Rather than maintaining one yourself the most common way to use Kubernetes is by using a managed service by a cloud provider. Such as Google Kubernetes Engine (GKE) or Amazon Elastic Kubernetes Service (Amazon EKS) which are both offering some credits to get started.

You have reached the end of this section! Continue to the next section: