From Development

Nomad vs. Kubernetes: container orchestration tools compared

There is a new player in the container orchestration arena. HashiCorp's Nomad is a recent addition to the pool of technologies designed to schedule and orchestrate tasks in the server/client relationship. Described as simple to run and maintain, Nomad is grabbing the attention of developers looking for alternatives to Kubernetes.

But why use Nomad instead of Kubernetes, and when? Let's look at the differences between Nomad and Kubernetes, their main features, benefits, and drawbacks.

Table of contents

The importance of containerization
What is Kubernetes?
What is Nomad?
Nomad vs.Kubernetes: key differences
    ➤  Nomad vs Kubernetes: Popularity
    ➤  Nomad vs Kubernetes: Installation
    ➤  Nomad vs Kubernetes: Scalability
    ➤  Nomad vs Kubernetes: Networking
    ➤  Nomad vs Kubernetes: Requirements profile
    ➤  Nomad vs Kubernetes: Coding
    ➤  Nomad vs Kubernetes: Load Balancing
    ➤  Nomad vs Kubernetes: Integration
    ➤  Nomad vs Kubernetes: Graphical User Interface (GUI)
Nomad vs Kubernetes: how to choose?
    ➤  Nomad AND Kubernetes
Conclusion

The importance of containerization

First off, what is containerization? Applications need to run on various platforms and work with different OSs while using their own coding languages. Containers are packages carrying the application code, its libraries, and dependencies. They are lightweight components that connect the application to the operating system so code can run in any environment.

Container orchestration tools are the control center for the scheduling, deployment, and networking of containers. The most popular are:

  • Kubernetes
  • Openshift
  • Docker Swarm
  • Mesos
  • Helios

The main benefit of orchestration is automation. Orchestration tools reduce the complexity of managing, scaling, and monitoring containers in large numbers, accelerating the development and deployment cycles for developers and operators, increasing productivity, and minimizing human error.

The added benefit is cost reduction since it improves hardware operationality and resource usage. There is also a reduced risk of downtime thanks to automated rollbacks in case of deployment failure.

Of all of the orchestration tools available, Kubernetes is the most popular and considered the industry standard.

What is Kubernetes?

Kubernetes (aka "Kube" or k8s) is an open-source container orchestration platform written in Go. It was initially developed by Google in 2014 but is currently maintained by the Cloud Native Computing Foundation (CNCF).

According to surveys, Kubernetes usage share has grown from 58% in 2014 to 83% in 2021, being by far the most popular of the orchestration technologies. Leading public cloud providers like Amazon Web Services (AWS), Google Cloud Platform, IBM Cloud, and Microsoft Azure include managed Kubernetes services in their packages.

The popularity of Kubernetes has risen in the last few years, partly thanks to the use of YAML. Languages like Ruby, Python, or Javascript are more complex and promote infrastructure as code; with YAML the focus is on infrastructure as data.

The basic unit of Kubernetes is Pods. A pod is one or a group of containers with shared storage and network resource.

This shift allows for better scalability, security, control, and improved integration with cloud providers. Kubernetes' own fast development cycle, with new versions coming out every couple of months, promotes innovation, adapting quickly to developers' needs, thanks to a strong community effort, with a large number of groups invested in the evolution of the Kubernetes' project.

If you're interested in how Kubernetes works and how it compares to other containerization technologies, we recommend reading these articles from our blog:

What is Nomad?

Nomad is HashiCorps' answer to developers looking for a powerful yet flexible platform for application deployment or container orchestration.

Heralded as simple to run and maintain, Nomad is cloud-agnostic and designed to natively handle multi-datacenter and multi-region deployments with a high scalability potential. It is referred to as "Kubernetes without the complexity," but it's making a name for itself on its own merit.

Compared to other orchestration tools, Nomad is very easy to install since it's available as a precompiled binary, ready to work from a local machine. It runs any type of application in all sorts of environments, using common task drivers as plugins, like Containerd, Windows IIS, Firecracker, Podman, Docker, to name a few, and doesn't rely on any external services for storage or coordination.

Each installation can be tailored to the project's needs with plugins for specific functions. Nomad's Integration Program accepts plugins coded in Go, primarily.

Nomad can work as a traditional container orchestrator but also manage non-containerized applications, which is one of its strongest appeals for developers. Application, node, and driver failures are handled automatically, keeping each job's full definitions and deployment history for easy rollback and comparison. The smallest units of deployment in Nomad are called “Tasks” and they are the equivalent to “Pods” in Kubernetes.

But the strongest selling point of Nomad's ability to make the most out of hardware, improving performance and scalability. HashiCorp made their point on this feature through The 2 Million Container Challenge.

Nomad is open source, with an enterprise version, and was adopted by Trivago, Pandora, Target, eBay, and Roblox. With a flourishing community of developers behind it, Nomad is becoming a serious alternative to the established orchestrators.

Kubernetes vs. Nomad: key differences

The main difference between Nomad and Kubernetes is that Nomad is more versatile and lightweight. Nomad can work just as a simple task scheduler or take on heavier orchestration roles according to the project specifications. Nomad is part of a suite composed of complementary tools produced by HashiCorp:

  • Terraform, for fast infrastructure development;
  • Consul, for automatic service networking;
  • Vault, Hashicorp's secrets management tool;

Kubernetes comes as a full-featured platform, with all the components included. Nomad leaves out most of those components that can be added later if necessary, minimizing the need for external dependencies.

Comparing Kubernetes and Nomad Source: A Kubernetes User's Guide to HashiCorp Nomad

Popularity

In the last few years, Kubernetes became the synonym for container orchestration. According to a 2021 Red Hat survey, 85% of IT leaders agree that Kubernetes is “important”, “very important” or “extremely important” to cloud-native application strategies. Nomad is still amassing popularity, but it has been gaining traction among developers and companies.

When it comes to container orchestration, it's not about the number of users but how much traffic these platforms deal with. Kubernetes is ever-present in most of today's digital communications. Still, Nomad is part of Cloudflare's development environment, a company responsible for routing 10% of the world's internet traffic and a cornerstone of Roblox's and Pandora's scaling. It may not be as commonly used as Kubernetes, but it already has a tremendous influence.

Installation

Nomad is lightweight and easy to install. It comes as a simple binary to be deployed quickly in a local development machine or cloud environment, with the same consistency and functionality.

Kubernetes takes more time and resources to deploy, and the installation process is more complex. There are other lighter Kubernetes implementations that cover only a few of the full features. These are used for rapid development and testing, but they do not translate well into the production stage since they are prone to configuration inconsistencies.

Scalability

Kubernetes (as of publishing date) claims to support clusters up to 5,000 nodes, with 300,000 total containers, and no more than 150,000 pods.

Nomad showed it could scale to cluster sizes above 10,000 nodes. And the referred 2 million container challenge in 2020 validated their claims of superior scalability performance.

Networking

In Kubernetes, pods communicate via a peer-to-peer network. This networking model needs two CIDRs (Classless Inter-Domain Routers): one for the Node IP addressing and the other for services.

In Nomad, each task gets an IP by default. The respective ports then can be accessed directly or via sidecar proxies, using host networking, dynamic or static port forwarding with the assistance of the Consul component.

Requirements profile

Kubernetes demands more hardware and more staff, being used for high profile, long-term projects, with a bigger investment, in public cloud environments like Google Cloud Platform, Azure, or AWS.

Nomad is suited for smaller teams, with limited capacity for orchestration purposes, with shorter development deadlines, working on hybrid or on-premises environments.

Languages

Kubernetes uses YAML or JSON to define and deploy applications. This is an example of Job config using YAML:

apiVersion: batch/v1
kind: Job
metadata:
  name: pi
spec:
  template:
    spec:
      containers:
      - name: pi
        image: perl
        command: ["perl",  "-Mbignum=bpi", "-wle", "print bpi(2000)"]
      restartPolicy: Never
  backoffLimit: 4

Nomad uses the Hashicorp Configuration Language (HCL). Its main purpose is to define jobs, and making the definition of builds more flexible and convenient.

HCL is both a syntax and an API designed by Hashicorp to build structured configuration formats. It's a compromise between serialization formats like JSON and configuration formats built around languages like Ruby. It is easier to read and write by humans - just like YAML. Here’s a Job configuration code example for Nomad in HCL:

job "docs" {
  datacenters = ["dc1"]
  group "example" {
    network {
      port "http" {
        static = "5678"
      }
    }
    task "server" {
      driver = "exec"

      config {
        command = "/bin/http-echo"

        args = [
          "-listen",
          ":5678",
          "-text",
          "hello world",
        ]
      }
    }
  }
}

Load Balancing

A load balancer distributes incoming traffic from the internet to the front-end applications responsible for handling requests.

The most popular solution in Kubernetes for load balancing is Ingress, a specialized Kubernetes controller (all too similar to a pod). Ingress includes a set of rules to manage traffic and a daemon to apply them. These rules can be adapted for more advanced needs.

Nomad has a functionality similar to the Kubernetes' Ingress controller, which can also adapt easily to changes in configuration and scale.

Integration

Nomad works with Docker just like Kubernetes does and runs non-containerized workloads (Windows, Java).

Graphical User Interface (GUI)

Both have attractive, functional dashboards, providing a clear, straightforward management experience.

Nomad and Kubernetes Dashboards

Nomad vs Kubernetes: how to choose?

Kubernetes is a powerful collection of components that work together, integrated into one core unit. It is designed to deploy, manage and scale application containers across clusters of hosts, just like an operating system for cloud-native applications.

Nomad starts as a cluster manager and task scheduler, but it can be connected to other tools like Consul to expand its capabilities. Its flexibility to adapt to different roles makes Nomad very appealing to medium-sized companies with less hardware and staff resources. It's easier to start with, easier to maintain, but lacks community support.

But you don't even have to choose between Kubernetes and Nomad.

Nomad AND Kubernetes

Both platforms can work together, complementing each other: Kubernetes is used by global companies and is offered as a service by Google Cloud Platform, Azure, and AWS, the three most prominent cloud providers, because it is recognized as a powerful container orchestration tool with cutting edge features. But Nomad's agility makes it perfect for maintenance and core scheduling purposes.

Here's a head to head comparison:

 

  Kubernetes Nomad

Complexity

More complex but provides a higher level of control

Easier to start with, but more immature

Community

Superior community, providing tools, resources and support

Lacks a significative community, with the consequential lack of resources

Costs

Potencial higher costs due to larger teams and more demanding architecture

Requires smaller teams, less servers, and it’s less time consuming

Workload support

Focused on Linux containers

Nomad supports virtualized, containerized and standalone applications (Java, Windows apps and even binary.)

Openness

Community supported

It is closely tied to HashiCorp’s products and development

Conclusion

The containerization arena already had many competing (and, sometimes, cooperating) options catering to different goals and needs. Now we have one more. It doesn't seem Nomad will take over the ruling of Kubernetes any time soon, but it's lining up as a strong player.

Nomad can be the entry point to the world of container orchestration for many developers and companies who need a lightweight, simple, and easily adaptable solution to face different scenarios that do not require a heavyweight like Kubernetes, to grow at their own pace.

Found this article useful? You might like these too!

At Imaginary Cloud, we simplify complex systems, delivering interfaces that users love. If you’ve enjoyed this article, you will certainly enjoy our newsletter, which may be subscribed below. Take this chance to also check our latest work and, if there is any project that you think we can help with, feel free to reach us. We look forward to hearing from you!