OCIFBSD_ORCHESTRATION(3) FreeBSD Library Functions Manual OCIFBSD_ORCHESTRATION(3)

ocifbsd_orchestration — ocifbsd pod, stack, and scheduling library

#include <ocifbsd/orchestration.h>

int
orch_init(struct orch_config *cfg);

void
orch_shutdown(void);

int
pod_create(struct pod_spec *spec);

int
pod_start(const char *name);

int
pod_stop(const char *name, int timeout);

int
pod_delete(const char *name);

int
pod_scale(const char *name, int replicas);

int
stack_deploy(struct stack_spec *spec);

int
health_check_pod(const char *name);

int
rolling_update(struct pod_spec *new_spec);

int
scheduler_place(struct pod_spec *spec, struct node_info *nodes, int n_nodes);

The ocifbsd_orchestration library implements the high-level orchestration primitives used by ocifbsd(8) to manage pods, stacks, and rolling updates. It is not a standalone program; it is linked into the main ocifbsd(8) binary.

The library is organised into seven functional modules:

The library calls the container lifecycle functions (ocifbsd_create_container, ocifbsd_start_container, etc.) that live in the main ocifbsd(8) binary. When the library is loaded standalone, the () file in this directory provides stub implementations of those functions so the library can be linked and tested in isolation. When it is linked into the main ocifbsd(8) binary, the real implementations override the stubs.

The full public API is declared in <ocifbsd/orchestration.h>.

A service is fronted by a virtual IP (VIP). The load balancer distributes connections to the VIP across the service's ready replica endpoints using pf(4) redirection pools, native to FreeBSD and requiring no external daemon. () generates the ruleset and () loads it into a per-service anchor ocifbsd/lb/⟨service⟩. The lb_algorithm selects the pool type: roundrobin (the default) maps to a round-robin pool, iphash (or clientip session affinity) to a source-hash pool, and leastconn falls back to round-robin (pf(4) has no least-connections pool). Only replicas in the REPLICA_STATE_RUNNING state become backends, so the pool works regardless of which node a replica runs on as long as its address is routable.

() places each replica on the ready, uncordoned node with the best score, preferring nodes running fewer pods so replicas spread across the cluster. () registers a worker; () cordons or uncordons a node (a cordoned node keeps its pods but receives no new placements); and () reconciles the node set with the cluster membership, retiring nodes that have left while never retiring the local node.

/etc/ocifbsd/orchestration.conf
Orchestration defaults (replica limits, rolling-update parameters, health-check intervals).
/var/run/ocifbsd/pods
Per-pod state directory.
/var/db/ocifbsd/stacks
Stack manifests.

ocifbsd_network(3), pf(4), ocifbsd(8)

The ocifbsd_orchestration library first appeared in FreeBSD 16.0.

The ocifbsd_orchestration library was developed by REVYTECH, Inc.

FreeBSD 16.0-CURRENT June 5, 2026 OCIFBSD_ORCHESTRATION(3)