notes/IT/Hashicorp Nomad.md
2024-10-07 14:19:03 -06:00

30 lines
4.6 KiB
Markdown

# Terminology
## Cluster Terms
| Phrase | Definition |
| ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| agent | A process running in server or client mode. |
| client/node | A Nomad client is responsible for running tasks assigned to it. A client registers itself with servers and watches for 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 nodes. |
| dev_agent | The development agent is an agent configuration that provides useful defaults for running a single node cluster of nomad. |
## Work terms
| Phrase | Definition |
| ------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| task | The smallest unit of work in Nomad. Tasks are executed by task drivers like `docker` or `exec`, which allows 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. |
| task driver | Task drivers are used by nomad clients to execute a task and provide resource isolation. |
| group | A series of tasks that run on the same Nomad client. |
| job | The core unit of *control* for Nomad and defines the application and its configuration. It can contain one or many tasks |
| job_specification/jobspec | A job specification, also known as a jobspec defines the schema for nomad jobs. This describes the type of the job, the tasks and resources necessary for the job to run, job information like which clients it can run on, or 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 chose a client capable of running it and allocates resources on the machine for the ask(s) in the task group defined for the job. |
| workload artifact | The runnable blob to be scheduled on a task driver. Examples include docker images, raw binaries, java applications, and VMs using QEMU. |
# Typical Workflow
Running a task is generally done by:
1. *Define a job specification for your task(s):* it'll contain info like where the workload artifact is located, ports used by the service, the number of instances desired, and more.
2. *Deploying the job*: The jobspec is submitted to Nomad and it schedules an allocation for the job on one or more clients.
3. Updating and redploying the job.
# Resources
- https://developer.hashicorp.com/nomad/tutorials/get-started/gs-overview
- https://developer.hashicorp.com/nomad/docs/drivers