Nomad
Introduction to Nomad
Interested in talking with HashiCorp about your experience building, deploying, or managing your applications? Set up a time to chat!
What is Nomad?
Nomad is a flexible scheduler and workload orchestrator that enables you to deploy and manage any application across on-premise and cloud infrastructure at scale. Some of Nomad's main features include:
- Efficient resource usage - Nomad optimizes the available cluster resources by efficiently placing the workloads onto the client nodes of the cluster through a process known as bin packing.
- Self-healing - Nomad constantly monitors and detects if tasks stop responding and takes appropriate actions to reschedule them for high uptime.
- Zero downtime deployments - Nomad supports several update strategies including rolling, blue/green, and canary deployments to make sure your applications are updated with zero downtime to your users.
- Different workload types - Nomad's flexibility comes from its use of task drivers and allows orchestration of Docker and other containers, as well as Java Jar files, QEMU virtual machines, raw commands with the
exec
driver, and more. Additionally, users can create their own task driver plugins for customized workloads. - Cross platform support - Nomad runs as a single binary and allows you to orchestrate your application across macOS, Windows, and Linux clients running on-premises, in the cloud, or on the edge.
- Single unified and declarative workflow - Regardless of the workload type, the workflow for deploying and maintaining applications on Nomad is unified within a declarative job specification that outlines important attributes like workload type and configuration, service definitions for communication between components, and location values such as region and datacenter.
Read more about Nomad's key features and how it compares to other tools.
Important terms
To create a solid foundational understanding of Nomad, review these terms before moving on to the other tutorials in this collection.
Nomad setup
In the process of getting Nomad deployed and functional, you will encounter the following terms.
agent
- An agent is a Nomad process running in server or client mode.client
- A Nomad client is responsible for running the tasks assigned to it. It also registers itself with the servers and watches for any work to be assigned. When running the agent, the client may be referred to as a node.server
- A Nomad server manages all jobs and clients, monitors tasks, and controls which tasks get placed on which client nodes. The servers replicate data between each other to ensure high availability.dev agent
- The development agent is an agent configuration that provides useful defaults for running a single node cluster of Nomad. It runs in server and client mode and does not persist its cluster state to disk, which allows the agent to start from a repeatable clean state without having to remove disk based state between runs.
A Nomad cluster is typically made up of three to five server agents and many client agents.
Nomad operation
In the process of Nomad scheduling and running workloads, you will encounter the following terms.
task
- A task is the smallest unit of work in Nomad. Tasks are executed bytask drivers
likedocker
orexec
, which allow Nomad to be flexible in the types of tasks it supports. Tasks specify their required task driver, configuration for the driver, constraints, and resources required.group
- A group is a series of tasks that run on the same Nomad client.job
- A job is the core unit of control for Nomad and defines the application and its configurations. It can contain one or many tasks.job specification
- A job specification, also known as a jobspec defines the schema for Nomad jobs. This describes the type of job, the tasks and resources necessary for the job to run, job information like which clients it can run on, and more.allocation
- An allocation is a mapping between a task group in a job and a client node. When a job is run, Nomad will choose a client capable of running it and allocate resources on the machine for the task(s) in the task group defined in the job.
An application is defined in a jobspec with groups of tasks and once submitted to Nomad, a job is created along with allocations for each group defined in that jobspec.
Application workflow
A typical application workflow involves several steps and begins outside of Nomad.
The prerequisite for any application running on Nomad is having a workload artifact. Nomad supports a variety of artifacts including Docker images, raw binaries, Java applications, and virtual machine images using QEMU.
Nomad does not create these application artifacts but a CI tool like CircleCI, GitHub Actions, HashiCorp Waypoint, or a local build can be used to create and then push the artifacts to a repository from where Nomad can retrieve them when it schedules a job.
Once the application has been created, the workflow continues with Nomad.
- Creating the job specification - The jobspec contains the tasks required for the application including where the artifact resides, networking configurations like ports and service definitions, the number of instances desired, and more.
- Deploying the job - The jobspec is submitted to Nomad and it schedules allocations for the job on one or more clients, depending on the job configuration.
- Updating and redeploying the job - The application code or the jobspec are updated and then resubmitted to Nomad for scheduling.
The Quick Start collection
This collection is your guide to becoming familiar with Nomad through hands-on tutorials. The following tutorials will show you how to install the Nomad CLI tool, create a Nomad cluster, and deploy an example application.
By the end of the collection, you will have a Nomad cluster of your own and an application running on it that you can modify and redeploy.
Next steps
Continue on to the installation tutorial by clicking on the Next button below and learn how to install the Nomad CLI.