ServerlessBase Blog
  • Nomad vs Kubernetes: When to Choose What

    A comprehensive comparison of HashiCorp Nomad and Kubernetes for container orchestration, deployment strategies, and use cases.

    Nomad vs Kubernetes: When to Choose What

    You've decided to orchestrate your containers. Now you face the classic dilemma: Kubernetes or Nomad? Both are production-grade orchestration platforms, but they solve the same problem in fundamentally different ways. Understanding these differences isn't academic—it determines how your team works, how you architect your infrastructure, and how much operational overhead you'll carry.

    The Fundamental Difference

    Kubernetes is a specialized container orchestration platform. It excels at managing containers, but that's all it does. Everything else—service discovery, networking, storage, monitoring—must be configured or integrated.

    Nomad is a general-purpose workload scheduler. It was designed to run batch jobs, databases, and containers alongside traditional applications. Kubernetes is a container specialist; Nomad is a generalist that happens to support containers.

    This distinction shapes every architectural decision you'll make.

    Architecture and Complexity

    Kubernetes: The Monolith of Orchestration

    Kubernetes introduced a massive amount of complexity to solve container orchestration problems. The architecture reflects this:

    • Control Plane: API server, etcd, scheduler, controller manager, cloud controller manager
    • Node Components: Kubelet, kube-proxy, container runtime
    • Add-ons: CoreDNS, CNI plugins, storage provisioners

    Every component has its own lifecycle, configuration, and failure modes. A single misconfiguration can bring down your entire cluster. The learning curve is steep—most teams dedicate weeks to understanding the core concepts before they can deploy a simple application.

    Nomad: The Simple Scheduler

    Nomad's architecture is deliberately minimal:

    • Server: Runs the scheduler and stores job definitions
    • Client: Runs the workload
    • Consul: Service discovery and health checking (optional but recommended)

    Nomad doesn't try to be everything to everyone. It schedules jobs, manages resource allocation, and provides basic networking. Everything else—service discovery, monitoring, logging—comes from external tools you already use.

    The simplicity is intentional. Nomad was built to be easy to operate. A single server can manage thousands of nodes and millions of tasks. The learning curve is gentle; most teams can get productive in a day.

    Resource Requirements

    Kubernetes: Heavyweight

    Running a production Kubernetes cluster requires significant resources:

    • Minimum: 3 nodes, 4 CPU cores, 8GB RAM each
    • Typical: 5-10 nodes, 8-16 CPU cores, 16-32GB RAM each
    • Control plane: Dedicated nodes or separate control plane cluster

    The control plane alone needs substantial resources. The etcd database grows with cluster state, and the scheduler and controller managers consume CPU and memory. Even an idle cluster costs money.

    Nomad: Lightweight

    Nomad runs efficiently on modest hardware:

    • Minimum: 1 server, 2 CPU cores, 4GB RAM
    • Typical: 3 servers, 4 CPU cores, 8GB RAM each
    • Client nodes: 2 CPU cores, 4GB RAM per node

    A single Nomad server can manage a cluster of 100+ nodes. The resource overhead is minimal compared to Kubernetes. You can run Nomad on the same hardware you'd use for your applications.

    Job Scheduling and Workload Types

    Kubernetes: Container-First

    Kubernetes is designed exclusively for containers. Every workload must be packaged as a container image. This works well for microservices, but it creates friction for other workload types:

    • Batch jobs: Requires containerization or init containers
    • Databases: Requires complex stateful sets and storage classes
    • Legacy applications: May not containerize easily

    Kubernetes provides extensive features for containers: rolling updates, health checks, resource limits, and scaling. But these features don't apply to non-container workloads.

    Nomad: General-Purpose

    Nomad was designed to run any executable:

    # Run a batch job
    nomad job run job.hcl
     
    # Run a database
    job "postgresql" {
      type = "service"
     
      group "db" {
        count = 1
     
        task "postgres" {
          driver = "exec"
          config {
            command = "/usr/lib/postgresql/14/bin/postgres"
            args = ["-D", "/var/lib/postgresql/data"]
          }
        }
      }
    }

    Nomad can run containers, VMs, bare metal binaries, and even shell scripts. This flexibility makes it ideal for mixed environments where you need to run diverse workloads.

    Networking and Service Discovery

    Kubernetes: Built-In Networking

    Kubernetes provides a complete networking stack:

    • CNI plugins: Calico, Cilium, Flannel, and others
    • Services: ClusterIP, NodePort, LoadBalancer
    • Ingress controllers: Nginx, Traefik, HAProxy
    • DNS: CoreDNS for service discovery

    The networking model is sophisticated but complex. You need to understand pods, services, ingress, and network policies. Troubleshooting network issues requires deep knowledge of the CNI plugin and Kubernetes networking model.

    Nomad: External Networking

    Nomad provides basic networking but relies on external tools:

    • Service discovery: Consul (recommended) or custom scripts
    • Load balancing: HAProxy, Traefik, or external LB
    • Ingress: Nginx, Traefik, or external LB
    • DNS: Consul DNS or external DNS provider

    Nomad doesn't try to replace your networking stack. It integrates with tools you already use. This keeps Nomad simple but requires you to manage additional components.

    Storage Management

    Kubernetes: Storage Classes and Provisioners

    Kubernetes provides a sophisticated storage model:

    • Storage Classes: Dynamic provisioning with CSI drivers
    • Persistent Volumes: Claim-based storage allocation
    • Storage Classes: Fast SSD, standard HDD, cloud storage
    • Backup tools: Velero, Restic, and others

    The storage system is powerful but complex. You need to understand persistent volumes, claims, storage classes, and backup strategies. A misconfigured storage class can lead to data loss.

    Nomad: Simple Volume Mounts

    Nomad uses simple volume mounts:

    task "app" {
      driver = "docker"
     
      config {
        image = "myapp:latest"
     
        volumes = [
          "local/data:/app/data:rw"
        ]
      }
    }

    Nomad doesn't provide advanced storage features. You mount volumes from the host or use external storage systems. This simplicity is a feature, not a bug. You don't need to learn a complex storage model.

    Scaling and High Availability

    Kubernetes: Native Scaling

    Kubernetes provides multiple scaling mechanisms:

    • Horizontal Pod Autoscaler (HPA): Scale pods based on CPU, memory, or custom metrics
    • Vertical Pod Autoscaler (VPA): Adjust resource requests and limits
    • Cluster Autoscaler: Scale nodes based on pod resource requests
    • Cluster scaling: Add or remove nodes dynamically

    Scaling is integrated into the platform. You configure autoscaling policies, and Kubernetes handles the rest. The system is robust but complex.

    Nomad: Simple Scaling

    Nomad provides basic scaling:

    group "web" {
      count = 3
     
      task "app" {
        driver = "docker"
        config {
          image = "myapp:latest"
        }
      }
    }

    You define the desired count, and Nomad schedules the tasks. Scaling is straightforward but manual. You don't get automatic scaling based on metrics, but you can integrate with external monitoring tools.

    Ecosystem and Tooling

    Kubernetes: Massive Ecosystem

    Kubernetes has an enormous ecosystem:

    • Orchestration tools: K3s, MicroK8s, Minikube (for development)
    • Monitoring: Prometheus, Grafana, Datadog, New Relic
    • Logging: Fluentd, Fluent Bit, Loki, ELK Stack
    • Service mesh: Istio, Linkerd, Consul Connect
    • Backup: Velero, Restic
    • Security: Falco, OPA, Kyverno

    The ecosystem is vast but fragmented. You need to select and integrate multiple tools. Each tool has its own configuration and learning curve.

    Nomad: Focused Ecosystem

    Nomad has a smaller but focused ecosystem:

    • Orchestration: Nomad, Nomad Enterprise
    • Service discovery: Consul (recommended)
    • Monitoring: Prometheus, Grafana
    • Logging: Fluentd, Fluent Bit, Loki
    • Service mesh: Consul Connect
    • Backup: Nomad snapshots, external tools

    The ecosystem is smaller but integrated. Consul provides service discovery, health checking, and service mesh capabilities. You get more with fewer tools.

    Learning Curve and Operational Overhead

    Kubernetes: Steep Learning Curve

    Kubernetes has a steep learning curve:

    • Concepts: Pods, services, deployments, stateful sets, daemon sets, jobs, cron jobs
    • APIs: RESTful API with complex resources
    • Configuration: YAML manifests with extensive options
    • Troubleshooting: Complex logs, events, and debugging tools

    Most teams spend weeks learning Kubernetes before they can deploy applications. Operational overhead is high—you need cluster operators, SREs, and developers who understand Kubernetes deeply.

    Nomad: Gentle Learning Curve

    Nomad has a gentle learning curve:

    • Concepts: Jobs, groups, tasks, drivers
    • API: Simple REST API
    • Configuration: HCL or JSON with minimal options
    • Troubleshooting: Simple logs and status commands

    Most teams can get productive in a day. Operational overhead is low—you need fewer specialized operators. Developers can manage Nomad jobs without deep Kubernetes knowledge.

    Use Cases: When to Choose Which

    Choose Kubernetes When:

    • You're building a microservices architecture
    • You need advanced networking features
    • You want a mature ecosystem with extensive tooling
    • You have a dedicated operations team
    • You're already invested in Kubernetes
    • You need complex scheduling and resource management

    Choose Nomad When:

    • You need to run diverse workloads (containers, VMs, batch jobs)
    • You want a simple, easy-to-operate platform
    • You have limited operational resources
    • You need to manage mixed environments
    • You prefer a gentle learning curve
    • You want to avoid Kubernetes complexity

    Migration Considerations

    Kubernetes to Nomad

    Migrating from Kubernetes to Nomad is challenging:

    • Workloads: Container images must be compatible with Nomad's driver
    • Networking: Existing services and ingress configurations need adaptation
    • Storage: Persistent volumes and storage classes must be mapped to Nomad volumes
    • Monitoring: Existing monitoring stacks need integration with Nomad
    • Team skills: Developers need to learn Nomad's job definition language

    The migration requires significant effort and planning. Most teams start with a pilot workload and gradually migrate additional workloads.

    Nomad to Kubernetes

    Migrating from Nomad to Kubernetes is also challenging:

    • Workloads: Non-container workloads must be containerized
    • Networking: Nomad's simple networking model must be replaced with Kubernetes services and ingress
    • Storage: Volume mounts must be converted to persistent volumes and claims
    • Monitoring: Existing monitoring stacks need integration with Kubernetes
    • Team skills: Developers need to learn Kubernetes concepts and YAML manifests

    The migration requires containerization of workloads and significant architectural changes.

    Cost Comparison

    Kubernetes: Higher Costs

    Running Kubernetes incurs higher costs:

    • Infrastructure: More resources required for control plane and nodes
    • Operations: More specialized operators needed
    • Tooling: More tools to purchase or integrate
    • Time: More time spent on Kubernetes-specific tasks

    A production Kubernetes cluster can cost 2-3x more than a comparable Nomad cluster.

    Nomad: Lower Costs

    Running Nomad incurs lower costs:

    • Infrastructure: Fewer resources required
    • Operations: Fewer specialized operators needed
    • Tooling: Fewer tools to purchase or integrate
    • Time: Less time spent on platform-specific tasks

    A production Nomad cluster can cost 50-70% less than a comparable Kubernetes cluster.

    Real-World Examples

    Kubernetes Success Stories

    Large companies use Kubernetes for complex microservices architectures:

    • Spotify: Runs thousands of containers across multiple clusters
    • Google: Developed Kubernetes and uses it extensively
    • Airbnb: Migrated from Mesos to Kubernetes for microservices orchestration
    • eBay: Uses Kubernetes for container orchestration

    These companies have dedicated teams to manage Kubernetes complexity.

    Nomad Success Stories

    Companies use Nomad for mixed workloads and simplicity:

    • HashiCorp: Uses Nomad internally for diverse workloads
    • InfluxData: Runs databases, batch jobs, and containers on Nomad
    • Puppet: Uses Nomad for container and VM orchestration
    • Walmart: Uses Nomad for batch processing and containers

    These companies value simplicity and operational efficiency.

    Making the Decision

    Choosing between Kubernetes and Nomad requires honest assessment of your needs:

    1. Workload types: Do you need to run only containers, or diverse workloads?
    2. Team expertise: Do you have Kubernetes experts, or do you need a simpler platform?
    3. Operational resources: Do you have dedicated operators, or do you need to minimize overhead?
    4. Ecosystem needs: Do you need a massive ecosystem, or are you comfortable with focused tooling?
    5. Learning curve: Are you willing to invest weeks in learning Kubernetes, or do you need a gentle learning curve?

    Conclusion

    Kubernetes and Nomad are both capable orchestration platforms, but they serve different needs. Kubernetes is the industry standard for container orchestration, with a massive ecosystem and advanced features. Nomad is a simpler, more flexible platform that excels at running diverse workloads with minimal operational overhead.

    Choose Kubernetes when you need advanced container orchestration features and have the operational resources to manage complexity. Choose Nomad when you want simplicity, flexibility, and lower operational overhead.

    The right choice depends on your specific requirements, team expertise, and operational constraints. Evaluate both platforms carefully, and don't be afraid to start with a pilot workload to see which platform fits your needs.

    Platforms like ServerlessBase can simplify deployment and management for both Kubernetes and Nomad, reducing operational overhead and accelerating time to production. Whether you choose Kubernetes or Nomad, having a deployment platform that handles the complexity can help your team focus on building applications rather than managing infrastructure.

    Leave comment