이 문서는 Nomad 학습을 위해서 작성되었습니다.
Nomad에 대한 기본적인 소개부터 Deploying, Securing, Interacting 부터 Nomad Job과 상호작용/확장하는 것부터 Nomad 환경변수를 다루는 것을 포함하고 있습니다.
Nomad란?
Nomad는 Container Orchestrator 툴 중 하나로 아래와 같은 특징을 가지고 있습니다.
Much simpler alternative to kubernetes
Nomad can deploy, manage, and scale containers for your environment
You can use Nomad to deploy containers on-prem, at the edge, and on any cloud platform. Multi-region and multi-datacenter support.
Nomad can scale to thousands of nodes in a single cluster
Supports non-containerized as well, such as VMs, binaries, and more…
Tight integration into the HashiCorp ecosystem.
Nomad는 기본적으로 2가지 역할로 나누어서 작업을 진행합니다.
Develoepr : Nomad Job 작성
Operator : Nomad Policies 작성
이 작업들은 AWS WEST, AZURE WEST, ON-PREM 까지 폭 넓게 배포될 수 있습니다.
Nomad Components
대표적인 Nomad Components는 Node와 Agent로 구분됩니다.
Target | Definition |
---|---|
Node | A Physical or virtual machine in the cluster. |
Agent | Long-running daemon running on every member of the Nomad cluster. |
Node Agent Component는 2가지 모드로 구분됩니다.
Target | Definition |
---|---|
Server Mode | An agent running on a server that holds the global state of the cluster and participates in scheduling decisions. |
Client Mode | An agent that fingerprints the host to determine the capabilites, resources, and available drivers. |
추가적으로 아래의 Nomad Components들도 존재합니다.
Target | Definition |
---|---|
Job | Definition of how a workload should be scheduled. |
Job Specification | An HCL configuration file on disk which how a workload should be scheduled. |
Driver | Pluggable components that execute a task and provide resource isolation. |
Task | A command, service, application, or “set of work” to be executed by Nomad. Tasks are executed by their driver. Examples include:
|
Task Group | A collection of individual task that should be co-located on the same node. This is especailly useful for applications that require low latency or have high throughput to another application in the task group |
Evaluation | A calculation performed by the Nomad servers to determine what action(s) need to take place to execute a job. |
Allocation | The mapping of tasks in a job to clients is done using allocations An allocation is used to declare that a set of tasks in a job should be run on a particular node. Allocations can fail if there are not enough resources to execute the task, a node is down, etc. |
전체적으로 Nomad Component Scheduling Flow를 보면 다음과 같습니다.
Job
Submitted by users
Represents desired state
Trigger an evaluation when submitted
Evaluation
Compared current state to desire state
Evaluates the state and reconciles it
Allocation
Map the tasks in the job to a client
Determines set of tasks that should run on a client
Client
Runs the set of tasks defined in the job spec.
This is where the containers are scheduled.