Last active
August 12, 2020 11:10
-
-
Save mkfares/2e41817bdd679246a0f419fa26347e73 to your computer and use it in GitHub Desktop.
Revisions
-
mkfares renamed this gist
Aug 12, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
mkfares created this gist
Aug 9, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,27 @@ # Docker Swarm - Definitions A **swarm** is a collection of docker hosts that collaborate together to execute containers. The docker engine is installed on each host of the swarm. The hosts in the swarm are called **nodes**. The nodes may run on physical computers or virtual machines. These nodes can play the role of manager, worker or both roles. The **managers** are nodes that manage, coordinate and delegate services to nodes. On the other hand, **workers** are nodes that execute containers. By default, all managers are also workers. A **service** is a desired state of a container. The state is defined as number of replicas, network and storage resources available to the service, ports the service exposes to the outside world, and other information. Docker services are managed using the docker service command. A **task** is a running container that is defined by a service. It is considered as the atomic scheduling unit of a swarm. Tasks are managed by the swarm manager and executed on workers. A user cannot manage the tasks directly. A **stack** manages one or mores services in a swarm. A swarm may have multiple stacks. A stack is used to manage an application that includes multiple services. The stack is defined using the docker compose file. A swarm manager provides a **load balancer** that distributes requests among services and exposes service ports to the outside world. A swarm includes a **DNS server** which assigns names to services. These names are used in applications to access services such as databases and APIs. The docker swarm does not need a separate software since it is automatically installed when docker engine is installed on your machine. The docker swarm has many advantages over docker compose: - Docker swarm management is part of the docker engine. The management of the entire cluster is performed on one of the swarm managers. - Docker swarm uses the docker-compose file and dockerfile to configure services and create containers (tasks). - The number of tasks can be scaled up or down automatically by the swarm manager. - Docker swarm creates an overlay network that spans all the nodes in a swarm. - Services are incrementally updated to avoid application down time. The performed updates can be rolled back.