Skip to content

chant kube

chant kube is the operator’s view of the same live-cluster data that lifecycle diff --live and behold consume. Every verb goes through the typed API client — same cluster binding, same credentials, same honest error reporting — so what you see in the terminal is what chant’s other surfaces see, never a second opinion.

It mounts through the lexicon command seam, so it exists only in projects whose config loads the k8s lexicon.

VerbWhat it does
get <kind> [name]List or read any kind the cluster serves — built-in or CRD. Accepts declared chant entity names too. -n, -A, -l, and -o text|wide|json|yaml|name|chant|jsonpath=|custom-columns=. In a chant project, adds a per-row verdict column (declared / drifted / runtime / orphan).
describe <kind> <name>Identity, chant verdict and provenance, spec/status, and recent Events in one view.
logs <pod>Pod logs — -c, --tail, --since, -p, --timestamps. Snapshot only; there is no --follow yet.
events [--for=Kind/name]Cluster events, oldest first.
top pods|nodesUsage from metrics.k8s.io, with an explicit “metrics-server not installed?” error instead of an empty table.
wait <kind> <name> --for=…The same readiness registry the waitForReady Op activity uses — --for=condition=…, --for=delete, --timeout.
source <kind> <name>Live object → the .ts file and composite that declared it, via chant’s provenance.
apply -f <file>Server-side apply through the same function the kubectlApply activity calls. Dry-run by default; --yes persists. Field-manager conflicts render with the owning manager and contested paths named.
delete <kind> <name>Typed delete — the same call the prune path uses. Preview by default; --yes deletes. Warns visibly when the object is not chant-owned. No bare sweeps: an explicit kind and name are required.
versionThe pinned Kubernetes schema version this lexicon was generated against.

The environment binding is honored everywhere. --env <name> resolves k8s.profiles.<env>.context from chant.config.ts; a mismatch with the ambient context is a refusal, not a silent read of the wrong cluster. --context overrides explicitly.

Absence and unreadability are different answers. A kind the cluster can’t serve, an RBAC denial, or a connection failure renders as not observed with its reason — never as No resources found.

Writes share the deploy path. apply and delete call the exact functions the Op activities call — same field manager identity (chant:<stack>), same conflict surface, same ownership checks. There is no parallel implementation to drift.

behold’s npm run demo:k8s is a one-command tour of everything on this page against a real (local) cluster: it brings up a single-node k3d cluster, deploys a chant-declared app via server-side apply, and walks declared → managed → runtime children → an induced out-of-band change surfacing as field-level drift — including the conflict refusal that names the intruding field manager. Docker is the only prerequisite; the cluster tears itself down on exit.

logs --follow (needs a streaming seam the client doesn’t have yet), -o go-template, kubectl’s per-kind describe templates, and top’s quantity summation. Each fails loudly rather than approximating.