# How argoCTL works

Source: https://argoctl-docs.pages.dev/docs/concepts/how-it-works

> The management server, the three networks, Ironic and virtual media, and how each command converges the site to the site file.

## The pieces

```text
                   ┌────────────────────────── mgmt (Ubuntu 24.04) ──────────────────────────┐
                   │  argoctl                                                                │
                   │  Ironic + httpd + MariaDB (Docker Compose)       Ansible (ansible-core) │
                   └───────┬──────────────────────────────┬──────────────────────────────────┘
            BMC (oob) net  │ Redfish                       │ provisioning net: SSH, Ironic API, images
                   ┌───────┴───────┐               ┌───────┴───────────────────────────┐
                   │ BMC  BMC  BMC │──virtual CD──▶│ node   node   node                │
                   └───────────────┘               └───────┬───────────────────────────┘
                                                           │ frontend net: Kubernetes, inference endpoints
                                                       clients
```

- **mgmt** runs `argoctl`. It is the only machine you log in to.
- The **BMC network** carries Redfish: argoCTL logs in to each BMC, reads its inventory, mounts images on its virtual CD and controls power and boot order. BMCs download those images from mgmt.
- The **provisioning network** connects mgmt to the nodes' operating systems: the deploy agent calls Ironic over it, and argoCTL and Ansible use SSH over it.
- The optional **frontend network** is where Kubernetes lives: node addresses, the API server and the inference endpoints your users call.

## Installing an OS without DHCP

Most bare-metal installers rely on DHCP and PXE. argoCTL doesn't: customer networks often can't offer them, and a stray DHCP server is a risk. Instead:

1. **Ironic** (the OpenStack bare-metal service, run standalone in Docker on mgmt) builds a small boot ISO for each node containing the deploy agent and that node's **static network configuration** (its provisioning MAC, IP, gateway and DNS from the site file).
2. Ironic mounts the ISO on the node's **virtual CD over Redfish**, sets a one-time boot from it and powers the node on.
3. The agent boots, applies the static configuration, calls back to Ironic on mgmt, and writes the Ubuntu image to disk with a small **config drive**: hostname, SSH keys and the full static network configuration (every NIC from the site file).
4. Ironic ejects the ISO and boots the disk. cloud-init applies the config drive on first boot.
5. `argoctl provision` waits until every static address answers SSH with the right hostname.

Secure Boot stays as the BMC has it: every stage is signed (shim, signed by the Microsoft UEFI CA, then signed GRUB and kernel).

## Building the cluster

`argoctl create cluster` generates an Ansible inventory and variables from the site file and runs its built-in playbooks over SSH from mgmt:

1. **Host profile**: OS settings Kubernetes needs (swap off, kernel modules, sysctls, time sync, `/etc/hosts`), containerd and the Kubernetes packages at pinned, held versions, and kubeadm's own preflight checks.
2. **kubeadm**: a generated, validated configuration; `kubeadm init` on the control plane and `kubeadm join` on the workers. Join tokens are short-lived and never stored.
3. **Cilium** as the network plugin, installed with Helm, with pod addresses from the site file's pod range.
4. **GPU**: the NVIDIA GPU Operator on nodes with GPUs (driver, container toolkit, device plugin, monitoring), plus GPUDirect RDMA where InfiniBand or RoCE NICs are present.
5. **Checks**: nodes Ready, DNS, pod-to-pod traffic across nodes, NetworkPolicy enforcement, and GPUs usable from a pod.

The playbooks and every version are compiled into the argoctl binary, so the binary alone decides what runs. See [Versions](https://argoctl-docs.pages.dev/docs/reference/versions).

## Serving models

`argoctl analyse` reads each server's inventory and computes which models fit and how they should be split across GPUs. `argoctl deploy inference` then installs **vLLM** with Helm: one Deployment of replicas for models that fit in a node, or LeaderWorkerSet groups for models split across nodes. Each deployment gets an OpenAI-compatible endpoint. See [How models are placed on GPUs](https://argoctl-docs.pages.dev/docs/concepts/model-placement).

## Converging, not scripting

Every command compares what exists with what the site file asks for and changes only the difference:

- **Checks first.** A command validates everything it can (site file, BMC logins, Ironic health, SSH, plan) and stops with nothing changed if anything fails.
- **Idempotent.** Re-running a successful command reports `nothing to change`. Re-running is also the health check.
- **Resumable.** An interrupted run (Ctrl-C, a lost SSH session, a timeout) is finished by running the same command again.
- **Explicit about destruction.** Anything that wipes a disk or reinstalls a node needs a flag (`--reimage`) and never happens as a side effect.
- **Reports.** Every command prints a summary table, can print the same as JSON (`--json`), and writes a full [run log](https://argoctl-docs.pages.dev/docs/reference/logs).
