today I want to leave few notes about following video: https://www.youtube.com/watch?v=_uw1ISM_uRU which is done by Adrian Mouat.
First of all, what is orchestration definition: "The planing or coordination of the elements of a situation to produce a desired effect, especially surreptitiously".
So, what are elements in Kubernetes, Docker Swarm and Mesos maraphon?
What are desired effects? Here they are:
- Running application
- Automatically scale
- Fault tolerant
- Node failover, node rebalancing, health checks
- Efficient use of resources
- Require little of manual intervention
Swarm and compose
- Docker official solution
- Uses the same API as the Docker Engine
- Swarm arguably mainly "clustering"
- Compose for "orchestration"
In other words swarm is responsible for clustering, while compose for orchestration. If to compare swarm with Mesos and Kubernetes, it's possible to say that swarm is little bit simpler then two others.
First point, which is needed to be taken into account is Scheudiling. It consists of two steps: choose host for a container, choose strategy and filters/constraints.
Swarm has following scheduling strategies:
- Random. Takes around host and starts there container.
- Binpack. Completely fill container before moving to the next host.
- Spread. Tries to spread containers evenly across all hosts.
Binpack and spread are somehow in contrast between each other. In binpack you try to use most efficient use of resources, but if one of resources will die, you'll loose much more, then in case if one of spread resources will die.
Swarm filters, they describe which container can be executed on particular node. For example:
- Only nodes labeled staging
- Only nodes which have image
- Only nodes running a given container
Sample of docker compose file:
image: amouat/identiorca: 1.0
In presented fragment of yml file environmnet plays role of constraint.
means the following: redis container to come app next to identiorca_dnmonster_1.