> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Module 1 Summary

> Summary of migrating a small production setup from manual SSH deployments to a resilient Nomad cluster, covering architecture, declarative jobs, scheduling flow, self healing, and scaling challenges.

Let's step back and look at how Tidepool's platform changed.

A few weeks earlier, Tidepool ran on four machines that Maya managed manually. She deployed to each machine in sequence, and the only authoritative record of what should be running lived in her head.

When one machine's disk filled at two in the morning, the software on that host stayed down and Tidepool didn't notice until a customer emailed.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/l4I9ipyyKXTd2i-D/images/Learn-By-Doing-HashiCorp-Nomad/Foundations-From-SSH-to-Scheduler/Module-1-Summary/sam-wiki-servers-boxes-checked.jpg?fit=max&auto=format&n=l4I9ipyyKXTd2i-D&q=85&s=f733963e672d7aeb7ddea2ee071a56e7" alt="A presentation slide titled &#x22;A Few Weeks Ago&#x22; showing a cartoon avatar labeled &#x22;Sam&#x22; with icons for a notebook and a stopwatch and the text &#x22;a wiki nobody updated 31 minutes down.&#x22; On the right it reads &#x22;The record was a person.&#x22; and the lower half shows four checked server/container boxes labeled box-1 to box-4." width="1920" height="1080" data-path="images/Learn-By-Doing-HashiCorp-Nomad/Foundations-From-SSH-to-Scheduler/Module-1-Summary/sam-wiki-servers-boxes-checked.jpg" />
</Frame>

Today those same four machines are the client half of a resilient Nomad cluster, backed by three small servers that provide the control plane. Maya chose Nomad over [Kubernetes](https://learn.kodekloud.com/user/courses/kubernetes-for-the-absolute-beginners-hands-on-tutorial) for pragmatic reasons she can justify: a six-person company, no dedicated platform team, and a mixed workload that is not only containers. She understands the trade-offs too — a smaller ecosystem and fewer third-party tools when she needs community answers.

<Callout icon="lightbulb" color="#1CB2FE">
  Choosing a scheduler is a trade-off. Nomad's simplicity reduces operational burden for small teams and mixed workloads; Kubernetes offers a larger ecosystem if you need many platform integrations and managed services.
</Callout>

The cluster was created from just two small configuration files and one important number. Architecturally:

* Three servers hold cluster state and elect a leader.
* Four clients run workloads.
* Nomad uses three ports to carry cluster traffic: `4646`, `4647`, and `4648`.

Ports and their roles:

| Port | Protocol | Purpose |
| - | - | - |
| `4646` | TCP | HTTP API (submit jobs, query status) |
| `4647` | TCP | RPC (server-client control traffic) |
| `4648` | TCP/UDP | Serf gossip (cluster membership & failure detection) |

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/l4I9ipyyKXTd2i-D/images/Learn-By-Doing-HashiCorp-Nomad/Foundations-From-SSH-to-Scheduler/Module-1-Summary/file-not-command-servers-and-clients.jpg?fit=max&auto=format&n=l4I9ipyyKXTd2i-D&q=85&s=509d2692bb64c79fb937eadd39e208dc" alt="A presentation slide titled &#x22;A File, Not a Command&#x22; showing icons for three servers and four Docker clients, port numbers 4646 · 4647 · 4648, and the phrase &#x22;Two files and one number.&#x22; Below are four labeled boxes (box-1 to box-4) with server and container icons." width="1920" height="1080" data-path="images/Learn-By-Doing-HashiCorp-Nomad/Foundations-From-SSH-to-Scheduler/Module-1-Summary/file-not-command-servers-and-clients.jpg" />
</Frame>

What you hand Nomad is no longer an imperative sequence of SSH commands — it's a declarative job file that states the desired state. That file describes a job, which contains one or more groups, which contain tasks. These concepts matter when designing and operating workloads.

Job, group, task — quick reference:

| Resource | Use |
| - | - |
| Job | The top-level unit you submit to Nomad; describes the workload and scheduling constraints. |
| Group | A set of tasks that should be colocated or share lifecycle settings (e.g., sidecars). |
| Task | The actual unit that runs (a process, container, or script). |

When you submit a job, you don't choose a specific machine. Nomad compares the desired state (the job spec) with the cluster's current state and generates an evaluation. The scheduler converts that evaluation into a placement plan. The elected server leader turns the plan into allocations — concrete assignments of work to particular clients. An allocation represents the actionable unit that runs on a real machine.

Scheduling flow (high level):

1. Submit a job (declarative file).
2. Nomad produces an evaluation comparing desired vs actual state.
3. The scheduler generates a placement plan.
4. The leader commits the plan and creates allocations.
5. Clients receive allocations and start tasks.

Because this loop runs continuously, the cluster self-heals. When Maya intentionally stopped one host, Nomad re-ran the process and rescheduled the work to other clients, keeping Tidepool available.

<Callout icon="warning" color="#FF6B6B">
  Declarative scheduling reduces manual toil, but you should still plan for capacity limits and service discovery — Nomad reschedules tasks, but you must decide how many replicas and how they are discovered.
</Callout>

Tidepool moved from four manually managed machines to a self-healing cluster. That leaves Maya with two important next questions as the platform grows:

* What happens when a single API instance isn't sufficient and she needs more replicas than her four machines can host?
* Once multiple copies of the API run (possibly on ephemeral ports), how do other services discover and route traffic to them?

These are the next problems to solve: capacity planning, scaling policies, and service discovery. For more on Nomad concepts and job specifications, see the official documentation: [https://www.nomadproject.io/docs](https://www.nomadproject.io/docs).

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/learn-by-doing-hashicorp-nomad/module/bbb9e697-2e59-4591-b750-678ef12293d3/lesson/7ddd39bd-163a-43f0-aeac-12ff779f8b7e" />
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.