Comparison of Container Schedulers

What is scheduling? What are containers?

Scheduling

Schematic overview of scheduling architectures, © Google, Inc. [48]

The container revolution

Virtual machines architecture compared to containers, © Docker Inc. [23]

Description of container schedulers

Docker Swarm

Docker Swarm architecture, ©Alexandre Beslic (Docker Inc.) [14]
  • strategy name: node selected
  • spread: has the fewest containers, disregarding their states
  • binpack: most packed (i.e. has the minimum amount of free CPU/RAM)
  • random: chosen randomly

Apache Mesos & Mesosphere Marathon

Apache Mesos architecture using Marathon, © Adrian Mouat [49]
  • Operator: role
  • UNIQUE: forces attributes’ uniqueness, e.g. the constraint [“hostname”, “UNIQUE”] ensures that there is only one application task running on each host.
  • CLUSTER: run your application on slaves that share a certain attribute, e.g. the constraint [“rack id”, “CLUSTER”, “rack-1”] obliges the application to run on rack-1 or to be in a pending state to wait for some free CPU/RAM on rack-1.
  • GROUP_BY: evenly spread your application across nodes with a particular attribute like a specific host or rack.
  • LIKE: ensures that the app runs only on slaves having a certain attribute. When there is only one value it is working like CLUSTER but many values can be matched because the argument is a regular expression.
  • UNLIKE: does the contrary of LIKE.

Google Kubernetes

Kubernetes architecture (containers in grey, pods in color), © Google Inc. [31]
  • Predicate: node’s requirements
  • PodFitPorts: needs to be able to host the pod without any port conflicts.
  • PodFitsResources: has enough resources to host the pod.
  • NoDiskConflict: has enough space to fit the pod and the volumes linked.
  • MatchNodeSelector: match the selector query parameter defined in the pod’s description.
  • HostName: has the name of the host parameter defined in the pod’s description.
  • Priority: node(s) considered as the best(s)
  • LeastRequestedPriority: calculates the percentage of memory and CPU requested by the pods that are already on the node. The node with the minimum percentage is the best.
  • BalancedResourceAllocation: nodes that have a similar memory and CPU usage.
  • ServiceSpreadingPriority: prefers the nodes that have different pods using them.
  • EqualPriority: only used for testing, give an equal priority to all the nodes in the cluster.

Conclusion

Comparison of container schedulers

Applications used to compare the schedulers

Voting application architecture, © Docker Inc [7]

Food Trucks Application

Voting application

Voting application organization, © Docker Inc [7]
EC2 machines to run the scalable application in a cluster.
Deploying a cluster using Mesos & Marathon can be done in 2 minutes.

Future work

Conclusion

Swarm frontends, © Docker Inc. [6]

Appendix

A — policy-config-file.json

B — docker-compose.yml

C — Mesos app definition (Elasticsearch)

D — Appendix — Mesos app definition (Flask)

E — Kubernetes pod definition

References

Senior software engineer working remotely at D2iQ (formerly Mesosphere).

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Armand Grillet

Armand Grillet

Senior software engineer working remotely at D2iQ (formerly Mesosphere).

More from Medium

Assign a fixed IP address to a container in Docker-Compose

Command for how to display Kubernetes pods with their nodes with kubectl

Accessing Docker tag as an environment variable inside a Docker container project

Reduce the size of your Docker images with docker-slim