Back to Coolify

v5 Host Primitives

docs/v5/architecture/primitives.md

4.3.03.4 KB
Original Source

v5 Host Primitives

Coolify deploy logic must send explicit primitives to coold through Flux. There must be no raw Podman passthrough.

This file is the target primitive catalog. Implementations may lag behind this catalog; code should only call primitives that exist in the current protocol.

Images

PrimitivePurpose
images.pullPull an OCI image ref onto a host.
images.listList local images.
images.deleteRemove a local image when safe.

Containers

PrimitivePurpose
containers.createCreate a container from an explicit spec.
containers.startStart an existing container.
containers.stopStop a container with an optional timeout.
containers.restartRestart a container.
containers.deleteDelete a stopped or forced container.
containers.inspectReturn detailed runtime state.
containers.listReturn host container summaries.
containers.logsStream or read container logs.
containers.execRun a command inside a container.
containers.healthcheck.runTrigger or read a runtime health check.

containers.create must enforce a deny filter for dangerous host options such as privileged mode, unsafe host mounts, host networking, and disallowed capabilities unless the host is explicitly configured to allow them.

Volumes

PrimitivePurpose
volumes.createCreate an idempotent named volume.
volumes.inspectInspect a host volume.
volumes.deleteDelete an unused volume.

Networks

PrimitivePurpose
networks.createCreate an idempotent Podman network.
networks.listList host networks.
networks.deleteDelete an unused network.

Bootstrap-created mesh namespace networks are managed by the v5 cluster init flow. Per-resource or compose networks are runtime primitives.

Firewall

PrimitivePurpose
firewall.allowAdd an allow tuple and persist it.
firewall.revokeRemove an allow tuple by ID.
firewall.listList active/persisted allow rules.
firewall.reconcileFlush and restore firewall state from snapshots.

coold is the sole writer for both firewall planes: iptables for cross-host traffic and nft bridge rules for same-bridge traffic.

Service discovery and DNS

PrimitivePurpose
services.registerRegister this host's container endpoint in Corrosion.
services.unregisterRemove an endpoint from Corrosion.
services.endpointsRead known endpoints for diagnostics.
dns.lookupDiagnose internal DNS resolution.
dns.statsReturn DNS server status.

Host facts

PrimitivePurpose
host.infoReturn host/runtime facts for scheduling and debugging.
host.statsReturn CPU, memory, disk, and container stats snapshot.
host.containersReturn host container summaries.

Builder (deferred)

Builder is intentionally not part of the active v5 Flux/coold primitive surface. Before reintroducing it, add an ADR/API covering scheduling, capacity, logs, artifacts, cancellation, restart adoption, and registry flow.

Not primitives

These belong in Coolify, not coold:

  • deploy.application
  • rollback.deployment
  • create.preview
  • configure.domain
  • authorize.user
  • send.notification
  • render.proxy.config