Mixing hosts in hybrid swarms

There's one more feature of swarm mode that makes it hugely powerful. Nodes in the swarm communicate using the Docker API, and the API is cross-platform—which means you can have a single swarm running a mixture of Windows and Linux servers. Docker also runs on different CPU architectures, so you can mix traditional 64-bit Intel servers with efficient new ARM boards.

Linux isn't the focus of this book, but I will cover hybrid swarms briefly because they open up a new range of possibilities. A hybrid swarm can have Linux and Windows nodes as managers and workers. You administer the nodes and the services they're running in the same way, using the exact same Docker CLI.

One use case for hybrid swarms is to run your manager nodes on Linux, to reduce licensing costs or running costs if you have your swarm in the cloud. A production swarm will need at least three manager nodes. Even if all your workloads are Windows-based, it may be more cost effective to run Linux nodes as managers - on ARM if that is an option - and save the Windows nodes for user workloads.

The other use case is for mixed workloads. My NerdDinner solution is using open source software that is available as Linux Docker images, but which I've had to package myself for Windows Server 2019 containers. I could migrate any cross-platform components to run in Linux containers on a hybrid swarm. That could be the .NET Core components from Chapter 5, Adopting Container-First Solution Design, as well as Traefik, the NATS message queue, Elasticsearch, Kibana, and even SQL Server. Linux images are typically much smaller and lighter than Windows images, so you should be able to run with greater density, packing more containers on to each host.

The great benefit of the hybrid swarm is that you manage all these components in the same way, from the same user interface. You can connect your local Docker CLI to the swarm manager and administer the Traefik proxy on Linux and the ASP.NET application on Windows with exactly the same commands.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.237.164