Container orchestration with Kubernetes, Docker Swarm and Mesos-marathon

Hello everybody,

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?

  1. Containers
  2. Hosts
  3. Networking

What are desired effects? Here they are:

  1. Running application
  2. Automatically scale
  3. Fault tolerant
  4. Node failover, node rebalancing, health checks
  5. Efficient use of resources
  6. Require little of manual intervention

Swarm and compose

  1. Docker official solution
  2. Uses the same API as the Docker Engine
  3. Swarm arguably mainly "clustering"
  4. 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.

Swarm

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.
  • Pluggable

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:

version: "2"

services:

           identiorca:

                      image: amouat/identiorca: 1.0

                      ports:

                                 -"9090"

                      depends_on:

                                 -"dnmonster"

                                 -"redis"

                      dnmonster:

                                 image: amouat/dnmonster:1.0

                      redis:

                                 image:redis:3

                                 environment:

                                            -"affinity:container==identiorca_dnmonster_1"

 

In presented fragment of yml file environmnet plays role of constraint. 

this part:

 

                                 environment:

                                            -"affinity:container===identiorca_dnmonster_1"

means the following: redis container to come app next to identiorca_dnmonster_1. 

No Comments

Add a Comment