Skip to content
Opod

Install

Install on bare machines

opodcp infra reads every host, runs a host gate, installs k3s server and agents over SSH, labels the nodes and writes a kubeconfig.

In short

This is Path B: Linux machines with GPUs and SSH, and no Kubernetes yet. opodcp infra builds a k3s cluster (a cell) over SSH, with one server or, in 0.3.0, three servers behind one virtual IP, labels the nodes and writes a kubeconfig. Then you install the chart exactly as on any cluster. You write one inventory file; infra plan shows what would change, and infra up changes it.

SSH is the only transport. The installer changes nothing on a host until you run infra up, and it never touches a host marked skip: true. It does not install GPU drivers: install the vendor driver (and, for NVIDIA, the container toolkit) yourself first.

When you need it

  • You have GPU machines in a lab, a colocation rack or a cloud account, and no Kubernetes on them.
  • You want one small cell to try opod, with k3s and nothing else installed by hand.
  • You add a machine to a cell that opodcp infra built, or rebuild one after the hosts were re-imaged.

Do it

  1. Get the binary

    The opodcp binary ships inside the image. Copy it out on a Linux machine that can reach every host over SSH:

    id=$(docker create ghcr.io/opod-io/opodcp:0.3.6)
    docker cp "$id":/opodcp ./opodcp && docker rm "$id"
    ./opodcp version
  2. Write the inventory

    # machines.yaml
    cell: prod-eu1                        # cluster name and node label opod.io/cell
    ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, sudo: true }
    servers:
      - { name: cp-1, host: 192.0.2.10 }
    agents:
      - { name: gpu-1, host: 192.0.2.11 }  # vendor detected on the host
      - { name: gpu-2, host: 192.0.2.12, labels: { topology.kubernetes.io/zone: eu1-b } }

    On 0.2.1 the server is one field, server: { name: cp-1, host: 192.0.2.10 }; the list servers: is new in 0.3.0. Every field is in The inventory below; three servers are in Three servers.

  3. Plan

    ./opodcp infra plan -f machines.yaml

    It gathers each host's facts, runs the host gate and shows what would change. Nothing is changed. A good plan prints one gate line per host and one planned (·) k3s step per host:

    ✔ gate                         [cp-1] … · none · 32GB · no k3s
    ✔ gate                         [gpu-1] … · nvidia · 128GB · no k3s
    ✔ gate                         [gpu-2] … · nvidia · 128GB · no k3s
    · k3s.server                   [cp-1] install k3s server v1.31.6+k3s1
    · k3s.agent                    [gpu-1] install k3s agent v1.31.6+k3s1
    · k3s.agent                    [gpu-2] install k3s agent v1.31.6+k3s1
     
    plan: 3 to install, 0 already installed — run: opodcp infra up -f machines.yaml

    The last line arrives in the release after 0.3.6: it counts what up would install and what already runs k3s, and names the next command.

    A failed row prints under its host as FATAL, warn or info, its id, the message and → a remedy. Fix it, or mark the host skip: true.

  4. Converge

    ./opodcp infra up -f machines.yaml

    It installs the k3s server, then the agents, sets the labels opod.io/cell, opod.io/role and opod.io/gpu-vendor, and writes a kubeconfig to ~/.opodcp/<cell>/kubeconfig. Each step records a proof:

    ✔ k3s.server                   [cp-1] https://192.0.2.10:6443 ready
    ✔ kubeconfig                   [cp-1] /home/ubuntu/.opodcp/prod-eu1/kubeconfig
    ✔ k3s.agent                    [gpu-1] Ready · vendor=nvidia
    ✔ k3s.agent                    [gpu-2] Ready · vendor=nvidia
     
    kubeconfig: /home/ubuntu/.opodcp/prod-eu1/kubeconfig

    k3s servers are installed with --secrets-encryption, so Secrets are encrypted at rest. Running it again is safe: a step that is already converged is not repeated. When the machine you run it on is the server, add --local: server steps run locally and agents over SSH.

  5. Check the cluster

    ./opodcp preflight --kubeconfig ~/.opodcp/prod-eu1/kubeconfig
  6. Install the chart

    export KUBECONFIG=~/.opodcp/prod-eu1/kubeconfig
    kubectl create namespace opodcp
    kubectl -n opodcp create secret generic opod-state --from-literal=dsn='postgres://opod:PASSWORD@db.example.com:5432/opodcp?sslmode=require'
    helm install opodcp oci://ghcr.io/opod-io/charts/opodcp -n opodcp \
      --set ports.state.dsnSecret.name=opod-state --set cell.name=prod-eu1

    On a LAN with no Ingress, add --set service.type=NodePort --set service.nodePort=30080. ports.state.dsnSecret is new in 0.3.0; on 0.2.1 leave it out. Then sign in as in Install on Kubernetes, step 4.

Check it worked

kubectl get nodes -L opod.io/cell,opod.io/role,opod.io/gpu-vendor
./opodcp infra verify -f machines.yaml

A good answer lists every host Ready, each with your cell name, its role (server, or worker on an agent) and its vendor. infra verify runs the host gate and the cluster preflight again, changes nothing, and exits 0. After the chart is installed, the console's Machines page lists the same nodes.

If it fails

SymptomCauseFix
gate failed — nothing changed, then error: plan did not complete cleanly (from the release after 0.3.6: error: infra plan did not complete cleanly — the ✘ rows above say why; every step is in ~/.opodcp/<cell>/runs.jsonl)a host has a fatal rowread the FATAL lines printed under that host; fix them or set skip: true
a gate step fails with remedy ssh user/key/port in the inventory; host must run bashSSH could not log incheck ssh.user, ssh.keyFile and ssh.port; try ssh -i KEY USER@HOST true
FATAL priv.rootthe SSH user has no passwordless sudogrant NOPASSWD sudo, or set ssh.user: root
FATAL gpu.toolkitan NVIDIA host has no nvidia-container-toolkitinstall it, then plan again
k3s.agent fails with host reachable but :6443 closedthe agent reaches the server, but the k3s port is closedopen TCP 6443 on the server firewall
k3s.server fails with remedy journalctl -u k3s on the serverthe k3s install failedread that journal on the server
k3s.server fails with REFUSED: this host runs a single k3s serverthe inventory lists three servers, and the first one already runs a one-server clusterthe installer does not convert a running cluster: opodcp backup, opodcp infra down, infra up with three servers, then restore
vip fails with the API does not answer on the vipkube-vip did not take the addressk3s kubectl -n kube-system logs ds/kube-vip-ds on the first server; check net.vip.segment
FATAL net.vip.freesomething on the network already answers on the VIPpick another free address, outside the DHCP range
FATAL net.vip.segmentthe VIP is behind a router from that serverpick an address in the subnet the three servers share: ARP does not cross a router
k3s.agent fails with remedy kubectl describe node gpu-1the agent joined but did not turn Ready within the waitread the node's conditions
a host key changed after a re-image--known-hosts holds the old keyremove that host's line from ~/.opodcp/known_hosts, or pin the new key as hostKey

The inventory

FieldDefaultMeaning
cell—cell name: the k3s cluster name and the opod.io/cell label
k3sVersionv1.31.6+k3s1pinned k3s version
ssh.user, ssh.keyFile, ssh.port—, ~/.ssh/id_ed25519, 22SSH defaults for every machine
ssh.sudo—run privileged steps with sudo -n; otherwise the user must be root
servers[]—the k3s servers: one, or three for a cluster that survives a server. Two is refused: etcd with two members stops when either one does. On 0.2.1 this is the single field server
vip—with three servers: a free IPv4 address on the servers' own subnet, outside any DHCP range. Required with three servers, refused with one
agents[]—the k3s agents
labels—extra labels on every node
modelCache/data/modelsthe host directory for model weights

A fuller inventory that uses every per-machine field:

cell: prod-eu1
k3sVersion: v1.31.6+k3s1
ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, port: 22, sudo: true }
labels: { opod.io/site: eu1 }            # on every node
modelCache: /mnt/nvme/models              # a fast disk for weights
servers:
  - { name: cp-1, host: 192.0.2.10, vendor: none }
agents:
  - { name: gpu-1, host: 192.0.2.11, nodeIP: 10.0.0.11 }          # SSH on one network, k3s on another
  - { name: gpu-2, host: gpu-2.example.com, user: root, port: 2222,
      hostKey: "ssh-ed25519 AAAAC3Nza…" }                          # pinned host key
  - { name: amd-1, host: 192.0.2.13, vendor: amd }                  # vendor stated, checked against the host
  - { name: old-1, host: 192.0.2.14, skip: true }                   # never touched

And a converge that refuses any host key it does not already know, waits longer per command, and keeps its state beside the inventory:

./opodcp infra up -f machines.yaml --strict-host-keys --known-hosts ./known_hosts \
  --timeout 40m --state ./state --json > run.json

--json prints the run (every step with its proof) on stdout; the progress lines stay on stderr.

Per machine: name (the node name), host (the SSH address), nodeIP (k3s --node-ip, default host when it is an IP), user, port, vendor (nvidia, amd, intel, tt or none; empty = detect on the host), labels, skip and hostKey (a pinned SSH host key).

Three servers

This is new in 0.3.0, and it is not yet proven on hardware.

One server is a single point of failure for the cluster itself: the control plane's replicas keep running when their node dies, but nothing schedules, heals or answers kubectl while the server is down. Three servers keep the Kubernetes API up when any one is lost.

cell: prod-eu1
ssh: { user: ubuntu, keyFile: ~/.ssh/id_ed25519, sudo: true }
servers:
  - { name: cp-1, host: 192.0.2.10, vendor: none }
  - { name: cp-2, host: 192.0.2.11, vendor: none }
  - { name: cp-3, host: 192.0.2.12, vendor: none }
vip: 192.0.2.50                          # free, same subnet as the servers, outside DHCP
agents:
  - { name: gpu-1, host: 192.0.2.21 }

What infra up then does, in order:

  1. The first server starts embedded etcd (--cluster-init) with the VIP in its certificate. Before k3s starts, the installer writes kube-vip (ghcr.io/kube-vip/kube-vip v1.3.1, pinned by digest) into k3s's auto-deploy directory. kube-vip announces the VIP by ARP from whichever server holds its lease. It covers the Kubernetes API only, and Services stay with k3s.
  2. Step vip waits until the API answers on https://<vip>:6443.
  3. The other two servers join through the VIP (--server https://<vip>:6443).
  4. The kubeconfig is written for the VIP, and every agent joins through it. A lost server then costs no agent and no kubectl its way in.

infra plan adds two fatal rows per server: net.vip.segment (the VIP is on that server's subnet) and net.vip.free (nothing answers on it yet). The installer refuses to convert a running one-server cluster to three in place.

For the control plane itself, run replicas: 3 (High availability). To reach the console at the VIP, use service.type=NodePort: a NodePort answers on every address of the node that holds the VIP, the VIP included. This is expected, not yet proven.

Commands

CommandWhat it does
opodcp infra plan -f FILEfacts and host gate, no changes
opodcp infra up -f FILEconverge: k3s server and agents, labels, kubeconfig. A kubeconfig it cannot fetch fails the run, with the command that fetches it by hand (the release after 0.3.6)
opodcp infra verify -f FILEhost gate plus the cluster preflight, no changes. With no kubeconfig yet it exits 1 and says to run infra up first (the release after 0.3.6; 0.3.6 skips the cluster check and exits 0)
opodcp infra down -f FILEuninstall k3s from every machine; asks first, --yes skips the question. From the release after 0.3.6, answering no removes nothing and exits 0, and with no terminal it refuses and prints the --yes command (0.3.6: error: aborted, exit 1)
FlagDefaultMeaning
-fmachines.yamlinventory file
--localfalsethe server is this machine (no SSH to it)
--state~/.opodcp/<cell>state directory (kubeconfig, run log)
--jsonfalseprint the run as JSON
--timeout20mper-command timeout
--yesfalseskip the confirmation of down
--known-hosts~/.opodcp/known_hoststhe SSH known_hosts file the installer keeps
--strict-host-keysfalserefuse a host whose key is neither pinned nor already known (no trust on first use)

infra down deletes every pod and the cluster state on those machines. Back up the control plane's database first if you want to keep it.

The host gate

infra plan and infra up read every host's facts and judge each machine. A host with a fatal row is never converged; fix it, or mark it skip: true in the inventory.

RowSeverityPasses whenRemedy
os.linuxfatalLinux on x86_64 or aarch64Windows hosts are not supported
os.cgroupv2fatalcgroup v2 is mountedboot with systemd.unified_cgroup_hierarchy=1 (the default from Ubuntu 22.04)
priv.rootfatalthe SSH user is root or has passwordless sudo -ngrant NOPASSWD sudo, or SSH as root
host.ramfatalat least 8 GB of RAM on an agent, 16 GB on the serveradd RAM, or move the server role to a host with 16 GB or more (the remedy is printed from the release after 0.3.6)
host.disk.rootwarningat least 40 GB free on /, for imagesfree space, or move the containerd root
host.disk.cachewarningat least 100 GB free for the model cache directorymount an NVMe disk there
host.timewarningthe clock is NTP-synchronisedenable systemd-timesyncd or chrony: TLS and join tokens need a sane clock
k3s.rolefatal, only when k3s is already thereit runs in the role the inventory gives this hostuninstall it (k3s-uninstall.sh, k3s-agent-uninstall.sh) or fix the inventory
gpu.vendorfatal on a mismatch, else informationthe inventory's vendor matches what the host reportsfix the inventory or the drivers
gpu.driverfatal on NVIDIA, warning otherwisethe vendor's kernel driver is loaded: NVIDIA, amdgpu, i915/xe, tt-kmdinstall the driver (Tenstorrent also needs hugepages)
gpu.toolkitfatal, NVIDIA onlynvidia-container-toolkit is installedinstall it; k3s then registers RuntimeClass nvidia by itself
gpu.presentwarning, agents onlyan accelerator is detecteda host with none can hold leaders and the control plane, not engines
net.vip.segmentfatal, servers of three onlythe VIP is on the server's own subnet (no router between)pick an address in the subnet the servers share
net.vip.freefatal, servers of three, before k3s is installednothing answers ping on the VIPpick another free address, outside DHCP
net.serverfatal, agents onlythe agent reaches the server on port 6443, tested from the agenthost reachable but :6443 closed: run the server step first or open 6443; cannot reach: give the agent a route to the server. An agent behind NAT only needs to dial out

Requirements → Nodes has the same thresholds from the buyer's side.

Last updated · Source: content/docs/control-plane-install/bare-metal.mdx · View as Markdown