Mesos vs Kubernetes

Photo of author

By admin

Mesos vs. Kubernetes

Today, every company is dependent on container technology. Containers are the small packages that bundle together your application along with their dependines to run on any environment irrespective of the underlying system and infrastructure. This has changed the working of the industries and is well adopted in the DevOps process. However, you can only manage a small number of containers running on various platforms. But when your company grows and wants to scale its applications accordingly, then it becomes difficult to handle thousands of containers.

This is where container orchestration comes into the picture to provide infrastructure to manage these thousands of containers by scheduling them accordingly. When we talk about orchestration, there are two main competitors present in the market- Mesos and Kubernetes.

But deciding between both the orchestration players is difficult as they both have their benefits. In the below article, we will look at the competencies that both the players offer and we can come to a conclusion to opt for one of them based on our requirements.

What is Kubernetes?

Google launched Kubernetes in 2014 as a container orchestration tool which is also known as K8s. It is a container orchestration platform well-suited for cloud-native computing services. Google launched it as its Container as a Service offering and now it is known as Google Container Engine.

It is an open-source system that helps in automating various tasks and deployments, scaling and managing the containerized applications. It has got extended support from other platforms like OpenShift, Azure, and many more. It has a simple and modular API core that offers its users with a powerful tool for container orchestration.

Architecture

Two main parts of this architecture are Kubernetes Master and Kubernetes Nodes. We will discuss the above parts in detail below:

Kubernetes Master– it manages and maintains the desired state of the cluster. It also helps in managing all the cluster nodes. The Master consists of three different processes.

  • kube-apiserver: this service helps in managing the entire cluster. It includes REST operations. It also validates ,and updates the Kubernetes objects, ensuring authentication and authorization.
  • kube-controller-manager: it is the daemon process that embeds the main control loop along with the Kubernetes. It will carry out the required modification for matching the current state of the clusters as per the desired state of the cluster.
  • kube-scheduler: This service scans the unscheduled pods, binds them together to the respective nodes and that completely depends upon requested resources and other constraints.

Kubernetes Nodes- these nodes are various machines or devices that run on the container. Every node is bundled with necessary services for running the container.

  • kubelet: it is a node agent that ensures that each container should be running fine.
  • kube-proxy: it is a network proxy that runs on every single node for performing a simple TCP, UDP, SCTP stream that forwards or round-robin forward across backend sets.
  • container runtime: it is a runtime software inside the pods that run and manages the components to run containers. There can be many container runtimes for Kubernetes that include the most widely used, Docker runtime.

Kubernetes Objects

These are the persistent Kubernetes entities reflecting the cluster’s state at any point of time. Below are the commonly used Kubernetes objects.

  • Pods: it is an execution unit of the Kubernetes containing more than one container. Every container within the pod is hosted in the same environment.
  • Deployment: it helps in deploying pods within the Kubernetes system, it offers various features like continuously reconciling pods’ current state with the desired state.
  • Services: it helps in providing an abstract way for exposing a group of pods, and this grouping is based on selectors that target the pod labels.

What is Mesos?

UC Berkeley developed an open-source cluster manager known as Mesos. It comes with various APIs that help in managing the resources and scheduling the clusters. You can use this platform for managing containerized and non-containerized applications in a distributed manner. It can easily scale very large clusters including thousands of hosts.

It works on a distributed approach for managing the clusters. It ensures a great flexibility while scaling the applications. Mesos can run many container management frameworks simultaneously, including Kubernetes, Apache Aurora, Mesosphere Marathon, and many more. It helps in abstracting various useful resources of the data center into a single pool. Apart from this, it helps in collocating the diverse workload and automating the day-two operations. It even offers ultimate extensibility for running new applications.

Architecture

The Mesos architecture comprises Master agent, and Application frameworks. We will discuss them in detail.

Frameworks: These are the applications that are appropriately distributed and manage the execution of tasks or workload like Hadoop or Storm. Mesos Framework consists of two main components:

  • Scheduler: it helps to register with the Master Node so that it can start offering resources.
  • Executor: this process runs on the every agent nodes that is responsible for running the framework’s tasks

Mesos Agents: these agents actually run the tasks. Each agent of the Mesos specifies the available system resources that includes CPU, storage, and memory and displays it to the master. Once agents get their individual task from the specified master, they will start allocating the required resources to the framework’s executor.

Mesos Master: it helps in scheduling the tasks. These tasks are received from the Frameworks on one of the available and running agent nodes. Master will provide the required resources to Frameworks. Then the framework scheduler will use the resources for running the tasks.

Characteristics of Kubernetes and Mesos

Characteristics Kubernetes Mesos/Marathon
Initial Release Date July 2015, v1.16 in Sept 2019 July 2016, Stable release August 2019
Deployment YAML based Unique format
Stability Quite mature and stable with consistent updates Mature
Design Philosophy Pod-based and resource-groupings Cgroups and control groups based in Linux
Images Supported Supports Docker and rkt Supports mostly Docker
Learning Curve Steep Steep

Tabular difference between Mesos and Kubernetes

Aspect Kubernetes Mesos
Types of Workloads cloud-native applications, containerized workloads big data, cloud-native applications,

containerized and non-containerized apps.

Application Scalability constructs each application layer is specified as pods that can

be scaled easily. It supports manual and automated scaling.

it scales an individual group along with its

dependencies.

High Availability pods are distributed among various worker nodes. applications are distributed among

various slave nodes.

Load Balancing the load balancer can expose the pods applications are available via Mesos- DNS,

acting as a load balancer

purpose ideal for new users and companies suitable for large systems
service discovery pods use intra-cluster DNS for searching the services it uses DNS or reverses proxy for searching

the services.

Difference between Mesos and Kubernetes

We have got enough context on both container orchestration platforms. But they differ in many aspects and without understanding where they differ from each other, we won’t be able to make an informed choice. This difference will keep everything in the right perspective. Below are the major differences between Mesos and Kubernetes.

Supported workloads

With Mesos, you can handle any type of containerized and non-containerized workloads or applications. Well, this depends on what framework you are using to run the applications. Some support containerized applications seamlessly like Marathon.

Kubernetes, on the other hand, supports containerized workloads or applications specifically. Typically, it is used with Docker containers. Currently, Kubernetes does not support multiple workloads, but it will in the future.

Scalability

With Mesos, the scalability is supported via the user interface. It allows you to scale the application groups automatically along with all dependencies.

On the other hand, Kubernetes handles every execution within pods which can be scaled easily. That is why pods are specified as the deployments. You can scale manually or automatically depending on the task.

Handling high availability

The application instances of Marathon are distributed across every agent of Mesos ensuring availability. In the same way, Kubernetes has pods that are distributed across several nodes to ensure availability.

Upgrades and rollbacks

Any change to the application definition is considered to be a deployment. With the deployment, you can start, stop, run, and scale applications. With Mesos, you can even roll back to run new versions with appropriate updates. It only requires to run the deployment with the updated definition.

While on the other hand, Kubernetes also supports the upgrade and rollback of the deployments. You only have to replace the old pods with new pods containing new definitions. Kubernetes maintains the rollback history by default, making it easier to roll back to an older version if required.

Logging and monitoring

With Mesos, you can easily scan all the components of the cluster. It provides you with data regarding health and other important metrics. You can use various APIs for querying and aggregating the captured data. You can use external tools for collecting the data metrics.

While on the other hand, Kubernetes provides detailed important information about all objects. It uses an external tool for gathering the metrics.

Conclusion

Containerization has been evolving constantly, providing a great working experience within the critical infrastructure handling many containers or applications. Container orchestration helps to handle such volume of containers seamlessly. It is important that you choose the right tool for your environment. We have mentioned two main competitors of Orchestration tools in the market. It is up to you, which tool you choose and implement it within your company.

Leave a Comment