1 Guides fleet
Forgejo Actions edited this page 2026-11-17 12:55:19 +00:00

Declaring the fleet

The fleet package records which Proxmox container runs which service. The deploy job refuses to touch a container that does not match its entry; see the design.

f := fleet.New()
f.Add(fleet.Service{
	ID:        "immich",
	Container: fleet.Container{Node: "kratos", CTID: 127, Hostname: "immich", IP: "192.168.1.127"},
	Kind:      fleet.CommunityScript,
	Script:    "immich", // SCRIPT_SLUG in the container's /usr/bin/update
	Routes:    []string{"photos"},
	Health:    "http://192.168.1.127:2283/api/server/ping",
})
app.Attach("fleet.json", f)

Kinds:

Kind Deploys
community-script Runs the container's /usr/bin/update
compose Docker Compose in the container
custom A bespoke reviewed script (e.g. the Caddy edge)
unmanaged Never; recorded for identity and drift only

Rules enforced when adding: unique ID, CTID, IP and route; private IPv4 only; community-script entries need the slug. fleet.Load re-applies the same rules to fleet.json, so a hand-edited file cannot skip them.

Checking from the Proxmox host:

yawn fleet-check -fleet fleet.json -service immich < observed.json   # exit 3 = refuse
yawn fleet-diff  -fleet fleet.json < observed-list.json              # nightly drift

observed.json comes from pct config and the container's update entrypoint (fleet.ParsePctConfig, fleet.ParseUpdateEntrypoint). Descriptions and other free text are never collected.