Kubernetes, Docker Swarm & Apache Mesos are the three big players in container orchestration. All three all fall into a class of DevOps infrastructure management tools that are also known as Container Orchestration Engines (COEs). Although Docker is the defacto standard for containerization, there are no clear winners in the orchestration space. Both Kubernetes and Mesos are the most commonly used orchestration systems in the Docker community and provide a gradient of usability versus feature sets that are rapidly evolving with time.

In our previous articles, we have already discussed in detail regarding the difference between Kubernetes and Docker Swarm. Let’s now look into how Kubernetes and Mesos are compared to each other and how they complement each other.

A short overview of Kubernetes

Kubernetes was designed by the Google from scratch to orchestrate Docker containers. Kubernetes was developed with the goal of empowering application developers, provide standard deployment interface, and build on a Modular API core that allows vendors to integrate systems around the core Kubernetes technology.

For an in-depth look, check out our previous blog post on what is Kubernetes.

A short overview of Apache Mesos

Initiated as a UC Berkeley project, Mesos was created as a next-generation cluster manager. It is open source software that provides efficient resource isolation and sharing across distributed applications or frameworks. Mesos is a distributed systems kernel, with a full API for programming directly against the datacenter. Mesos architecture consists of master process that manages slave daemons running on each cluster node, and frameworks that run tasks on these slaves.

Mesos gained popularity and was immediately adopted by Twitter, Apple (Siri), Yelp, Uber, Netflix, and many other prominent names in the technology world to support everything from micro-services, big data and real time analytics, to elastic scaling. For more information on Apache Mesos, do check out this terrific article here.

When to use Kubernetes or Mesos

Kubernetes is ideal for those who are new to the clustering world; it is the quickest, easiest and lightest way to flex your fingers and start experimenting with cluster oriented development. Kubernetes is highly versatile, large open-source development community and it offers a very high level of portability since it is being supported by a lot of various providers such as Microsoft, IBM, VMWare etc. From business point of view, Kubernetes is mainly recommended for companies that are production ready and require any type of containerized environment, big or small that is feature rich. It is best for medium-scale, highly redundant systems. However, managing Kubernetes requires a larger IT staff.

Mesos is best for large systems and it is designed for maximum redundancy. Mesos is recommended if you have existing workloads such as Hadoop, Kafka etc. It gives you a framework that lets you interleave those workloads with each other. Interestingly, Mesos is currently being adapted to add a lot of the Kubernetes concepts and to support the Kubernetes API. So it will be a gateway to getting more capabilities for the Kubernetes applications. Hence, it is the most stable platform, but overly complex for small-scale systems under 10-20 nodes. That’s why Mesos is usually recommended and is best for companies that use multi-cloud and multi-region clusters such as Twitter or Uber.

Strength & weaknesses of Kubernetes and Mesos

Kubernetes is clearly a market leader and is quite popular with the companies and developers. As Kubernetes is widely used, it has a large community behind it. There are a number of other platforms that support Kubernetes, including Red Hat OpenShift and Microsoft Azure. However, Kubernetes is expensive and provides no certification plans for the vendors.

Mesos may not be as popular as Kubernetes but it is supported by few large renowned organizations such as Twitter, Apple, Yelp etc. Major strength of the Mesos lies in the Big Data and analytics. Container orchestration is not exactly its core strength. As compared to Kuberneres, Mesos learning curve is steep and quite complex. Mesos does too much and is too generic that requires framework for most cases.

Comparison between features of Kubernetes & Mesos

Let’s compare five main features of Kubernetes and Mesos:

Application Definition

Kubernetes is a combination of Pods, Replication Controllers, Replica Sets, Services and Deployments, where Pod is a group of co-located containers; the atomic unit of deployment. In Mesos, Application Group models dependencies as a tree of groups. Components are started in dependency order.

Load Balancing

In Kubernetes, Pods are exposed through a Service, which can be a load balancer. In Mesos, application can be reached through Mesos-DNS, which can act as a basic load balancer.

High Availability

In Kubernetes, Pods are distributed among Worker Nodes. Whereas in Mesos, applications are distributed among Slave Nodes.

Storage

In Kubernetes, there are two storage APIs- The first provides abstractions for individual storage backends (e.g. NFS, AWS EBS, ceph, flocker). The second one provides an abstraction for a storage resource request which can be fulfilled with different storage back-ends.

In Mesos, a Marathon container can use persistent volumes, but such volumes are local to the node where they are created, so the container must always run on that node. To cater around this, experimental flocker integration supports persistent volumes that are not local to one node.

Networking

The networking model of the Kubernetes lets any pod communicate with other pods and with any service. The model requires two networks (one for pods, the other for services). However neither network needs to be reachable from outside the cluster. The most practical way of meeting this requirement is to deploy an overlay network on the cluster nodes.

In Mesos, Marathon’s docker integration facilitates mapping container ports to host ports, which is a limited resource. A container does not get its own IP by default, but it can if Mesos is integrated with Calico. Even so, multiple containers cannot share a network namespace (i.e. cannot talk to one another on local host).

In Summary

Both the technologies have something to do with Docker containers and they provide the access to container orchestration for application portability and scale. Both Kubernetes and Mesos aim to make it easier to deploy & manage applications inside containers in the datacenter or cloud. Both provide a level of blanket support to companies of all sizes.

In the end, it’s all about finding the right cluster management solution that fits the company’s individual depending upon their todays and future needs.

You can read all about Kubernetes and know everything that it involves in our all-encompassing post here!