Skip to content
Install the CLI

Reference CLI

status

These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.

kix status checks what Kix deployed. For every object of a Kix cluster’s current deploy, it answers three questions: is the object on the cluster, does it still hold what Kix applied, and is it ready. It reads the Kubernetes cluster through your kubeconfig and works outside a project directory. Inside a project (or with --flake), if CLUSTER does not match any deploy record on the Kubernetes cluster, Kix evaluates flake.nix to look up the name set in that cluster’s definition.

kix health, kix drift, and kix status --operator were removed in 0.10. Use kix status <cluster> --check presence, kix status [cluster] --check drift, and kix status <cluster> instead, in that order. The old forms stop with an error that prints [K6116] and names the replacement.

This page is hand-maintained. Check cli/kix-cli/src/cli/observe.rs and cli/kix-cli/src/commands/status/ when in doubt.

kix status [CLUSTER] [--check presence|drift|readiness]... [--package <NAME>]
[-o text|json|yaml] [-v] [-q] [--context <CONTEXT>]
Argument or flagMeaning
[CLUSTER]Kix cluster to check: either its key in flake.nix or the name on its deploy records (kix.run/cluster). When omitted, Kix checks every Kix cluster with a current deploy in the selected Kubernetes context.
--check <CHECK>Run only this check: presence, drift, or readiness. Repeat it to run more than one. Without it, all three run. Every check reports a missing object.
--package <NAME>Show only this package, by instance name (web) or namespace/instance (shop/web). An error when no checked cluster has the package. The error lists the packages, or the five closest names when there are more than ten.
-o, --outputtext (default), json, or yaml. Other formats are refused.
-vList every object, with or without a problem, and print the Kubernetes cluster ID.
-q, --quietPrint only the objects with a problem.
--context <CONTEXT>Kubeconfig context to read. Defaults to the current context.

--no-cache has no effect. --flake and --override-input apply only when CLUSTER matches no deploy record on the Kubernetes cluster and Kix evaluates flake.nix to look up the cluster’s deployed name. See Global flags.

Each check runs on every object that the cluster’s current deploy made. The current deploy is the cluster’s Active or Degraded Activation record.

CheckQuestionAn object fails when
presenceIs the object on the cluster?It is gone, for example after a kubectl delete.
driftDoes the object still hold what Kix applied?The fields Kix owns no longer hash to the applied hash Kix recorded for the object in its revision’s status.applied.
readinessIs the object ready?It is not ready by the rules kix deploy waits on, such as a Deployment with fewer ready replicas than it wants.

kix status checks only the objects listed in the current deploy record, with one exception: it also reports Kix-managed objects of this Kix cluster that are not in the current deploy and are still being deleted (see Objects being deleted). It never reports other extra objects on the cluster, whether orphaned from an earlier deploy or created outside Kix. See Objects Kix did not apply.

The readiness check reflects what Kubernetes and each object’s controller report on the cluster. It does not test external calls from inside your pods; for example, a pod that starts and passes its probes counts as ready even if a cloud API rejects its requests. See What readiness does not show.

A missing object is a problem under every check, because no check can run on an object that is gone. kix status --check drift and kix status --check readiness therefore also report missing objects.

When Kubernetes deletes an object, it sets metadata.deletionTimestamp and keeps the object on the cluster until every finalizer on it is removed, usually by the controller that added it. If an object in the current deploy is being deleted, every check (presence, drift, and readiness) reports it as being deleted (deleting in JSON and YAML) instead of changed or not ready. Its line shows when deletion started and any finalizers still on it. Run kix deploy <cluster> --reconcile (or deploy a change to the object) to wait for deletion to finish and recreate it.

If a Kix-managed object of this cluster is not in the current deploy and is still being deleted (for example, during kix deploy --prune or kix gc), kix status lists it after the packages under Not in the current deploy, still being deleted. Each one counts as a problem and is included on the summary line. --package narrows this list to objects from that package. Kept orphans that are not being deleted are not shown.

The drift check hashes only the fields Kix owns through server-side apply. A field Kix never set, such as one a controller adds, does not count. A change made through the /scale subresource, such as kubectl scale or an autoscaler, counts when Kix set the replica count. For a changed object, Kix reads metadata.managedFields to name each changed field and the field manager that now owns it. See Server-side apply and drift.

A Job that finished counts as present and ready. Jobs that Kix builds do not delete themselves, so a Job that is gone is missing.

When a deploy fails, the previous deploy record stays current. If a deploy has failed since the current deploy finished, kix status reports the failed deploy and exits 2. The header shows the failed deploy first (with when and why it failed), followed by the current deploy.

Any object in the failed build that is not in the current deploy (matched by kind, namespace, and name) is checked the same way and listed under Only in the failed deploy <record>. For example, this section includes a new LoadBalancer Service from the failed deploy that never received an address. Objects present in both builds are checked once under the current deploy against the live cluster state.

When another run holds the cluster’s deploy lock, kix status prints a line after the cluster’s notes showing who holds the lock, what it is doing, and how long ago it renewed its lease (measured by this machine’s clock):

kix deploy by ana@laptop, process 4242 holds the deploy lock (deploy of prod-3f2a9c1b04de), renewed 4s ago.

If more than 30 seconds have passed since the last renewal, the line notes that the lease has expired, the holder has likely stopped, and the next command that changes the cluster will take over the lock. Because kix status compares the timestamp against this machine’s clock, clock skew between machines can make a live lock look expired; only a command that changes the cluster watches the lock to confirm. kix status never waits for or takes the lock, and -q omits this line.

When a Deployment, StatefulSet, or DaemonSet is not ready, kix status inspects its pods and reports the same details that kix deploy shows while waiting: how many pods on the current revision are ready, why the first unready pod is waiting (such as a scheduling error or a failing readiness probe), and whether an unready pod on an older revision is blocking a StatefulSet update. This adds one or two API list requests per unready workload, and none for ready workloads. If Kix cannot list the pods (or the controller has not acted on the current revision yet), the output falls back to the counts on the workload’s status.

The text output has four parts:

  1. A line for each package, with its object count and either ok or the counts of its problems. Objects that no package owns, such as Namespaces and CustomResourceDefinitions, are listed under (cluster-level).
  2. The objects with a problem, grouped by package.
  3. Any objects not in the current deploy that are still being deleted.
  4. A summary line with the counts.
  5. When an object is missing or changed, a Next: line that names kix deploy <cluster> to restore what is missing or changed, and kix plan <cluster> to preview those changes first (see How a deploy decides what to write). When another field manager owns fields on a changed object and Kix does not co-own them (for example, after kubectl edit or kubectl scale), the line names that manager and notes that the deploy takes its fields back. A manager that co-owns all its fields with Kix changed none of them. When the manager is another Kix cluster (or kix from an earlier version of Kix), the line explains that kix deploy will not overwrite those fields and tells you to update the cluster definitions to match.
Cluster shop on Kubernetes v1.33.1 (context prod, https://prod.example:6443)
Last deploy: shop-7f3a2b1c0d9e Active 2d0h ago
db/postgres 2 resources 1 changed
ingress/ingress-nginx 1 resource ok
vault/vaultwarden 4 resources 1 not ready, 1 missing, 2 not checked
(cluster-level) 1 resource ok
db/postgres
ConfigMap db/pg-config changed since deploy (data.max_connections by kubectl-edit)
vault/vaultwarden
Deployment.apps vault/vaultwarden not ready (0/1 ready, 0/1 updated)
Secret vault/vaultwarden-db missing, needed by Deployment.apps vault/vaultwarden
8 resources: 3 ok, 1 changed, 1 not ready, 1 missing, 2 not checked.
Next: run `kix deploy shop` to restore what is missing or changed, or `kix plan shop` to preview the changes first. The deploy takes back the fields that kubectl-edit owns.
This account may not list secrets, so Kix did not check objects of those kinds.

With -v, the second part lists every object, and the header adds the Kubernetes cluster ID (the UID of the kube-system Namespace, the value cluster.kubernetes.uid takes):

Cluster shop on Kubernetes v1.33.1 (context prod, https://prod.example:6443)
Kubernetes cluster ID: 4d7b1c2e
Last deploy: shop-7f3a2b1c0d9e Active 2d0h ago
...
vault/vaultwarden
Deployment.apps vault/vaultwarden not ready (0/1 ready, 0/1 updated)
ConfigMap vault/vaultwarden-env not checked for changes: Kix has no recorded applied hash; `kix deploy` reapplies this object and records it
Secret vault/vaultwarden-db missing, needed by Deployment.apps vault/vaultwarden
Secret vault/vaultwarden-admin not checked: this account may not list its kind
(cluster-level)
Namespace vault ok

With -q, only the second part is printed. When more than one Kix cluster is checked, each cluster gets its own block, and a closing line gives the counts over all of them.

Some objects cannot be checked. Kix shows them as “not checked” and they do not fail the command:

  • A kind the account may not list. When listing a resource type returns 403, Kix cannot tell whether its objects are on the cluster, so it does not report them as missing. A closing line names the resource types.
  • No applied hash. Kix has no recorded applied hash for the object (for example, if a deploy stopped after applying the object but before recording its hash). The next kix deploy reapplies the object and records its hash. On clusters not yet upgraded to revisions, Kix reads the hash from the object’s kix.run/applied-hash annotation.
  • No field ownership entry for Kix. Kubernetes records no fields owned by the Kix cluster’s field manager (kix/<cluster>), so the drift check has nothing to compare.

The summary line and the package lines count these objects as not checked. ok counts only the objects that every selected check passed.

A missing object is gone from the cluster, so Kix cannot read its kind or name there. Kix names it from the first of these that has it:

  1. The deploy record. Each deploy links to revisions listing the kind, namespace, and name of every object (older records may list them in status.packageIndex).
  2. Kix’s local store, when it holds the deployed build.
  3. Neither. The object is shown as Unknown/(hash: xxxxxxxxxxxx...).

The line for a missing object names the objects that depend on it, such as missing, needed by Deployment.apps vault/vaultwarden.

A record with neither revisions nor a package index lists no objects. Kix then finds the deploy’s objects through the kix.run/depends-on annotations of the deploy’s live objects. When such a record’s own object is also gone, Kix cannot tell which objects the deploy made, says so, and exits 1.

-o json and -o yaml print one document. Its JSON Schema is cli/kix-cli/schema/status.schema.json. Programs that read it must skip fields and values they do not know.

FieldMeaning
schema_versionVersion of the document’s shape.
kubernetesThe Kubernetes cluster read: context, server (the API server URL in the kubeconfig, or null when not set), uid (null when the account may not read the kube-system Namespace), and version.
checksThe checks that ran: presence, drift, readiness.
unreadableResource types the account may not list, such as secrets.
clusters[]One entry for each Kix cluster checked.
clusters[].clusterThe Kix cluster name.
clusters[].deployThe current deploy record: name, phase (Active or Degraded), identity_hash, deployed_at, and deployed_with (the version of Kix that deployed, when the record says).
clusters[].objects_fromWhere Kix found the deploy’s objects: index (the record’s revisions, or status.packageIndex on older records), depends_on (the live objects’ kix.run/depends-on annotations), or unknown (nowhere; no object was checked).
clusters[].notesWarnings about the cluster, such as a changed platform interface, a Partial deployment record from kix deploy --only, or an earlier Failed deployment record (excluding the newest failed deploy already reported in Failed deploys).
clusters[].packages[]One entry for each package, with name (namespace/instance, or null for the cluster-level objects), summary, and resources.
clusters[].failed_deployThe newest deploy that failed since deploy, or null: name, identity_hash, failed_at, reason, packages (objects present only in the failed build, in the same shape as clusters[].packages), and summary (counts for those objects, which are excluded from the cluster’s summary).
clusters[].lockCurrent deploy lock holder, or null when the cluster is unlocked or this account cannot read activationheads.kix.run: holder (run ID), hint (human-readable caller), purpose (deploy, rollback, gc, migrate, repair, or teardown), activation (record being deployed, or null), renewed (RFC 3339 timestamp from the holder’s clock), seconds_since_renewal (measured by this machine’s clock, or null), and probably_dead (true when seconds_since_renewal exceeds the 30-second lease).
clusters[].leaving[]Kix-managed objects of this Kix cluster that are not in the current deploy and are still being deleted. Each entry has kind, group (omitted for core v1 kinds), namespace (null when cluster-scoped), name, package (namespace/instance, or null), deleting_since (metadata.deletionTimestamp), and finalizers.
summaryCounts over every cluster: resources, ok, missing, changed, not_ready, deleting (objects in the current deploy being deleted), leaving (objects in leaving[], not counted in resources, and 0 on a package summary), not_checked, and failed_deploys (Kix clusters where a deploy failed since the current deploy; 0 on a package summary). Each cluster and package has the same object. ok counts only the objects that every selected check passed. An object with two problems counts under both.

Each entry of resources[]:

FieldMeaning
kind, namespace, nameThe object. namespace is null for a cluster-scoped object. kind is Unknown when Kix cannot name a missing object.
groupThe kind’s API group, such as apps. Omitted for core v1 kinds.
identity_hashThe object’s kix.run/identity-hash.
namedfalse when Kix could not name a missing object.
presentyes, no, external (an import marker for an object Kix does not manage), unknown (the account may not list the kind), or ambiguous (no live object matches its identity hash, multiple API groups serve its kind, and an older deploy record lacks its API group; run kix deploy <cluster> --reconcile to record it).
driftnull when the drift check did not run or the object is gone. Otherwise verdict (in_sync, changed, unstamped, or no_fieldset), foreign_owners (other field managers, each with manager, operation, subresource, time, paths, and unshared_paths; unshared_paths lists the paths Kix does not co-own, which can conflict on deploy), and unrecorded_scale (a replica count changed through /scale that Kubernetes recorded no owner for).
readytrue or false (always false while an object is being deleted). null when the readiness check did not run, when the object is gone, or when the object is not being deleted and has no readiness check (such as a ConfigMap, or a Service of a type other than LoadBalancer).
not_ready_reasonWhy the object is not ready, such as 0/1 ready, 0/1 updated.
needed_byFor a missing object, the objects that depend on it, as Kind.group namespace/name (or Kind namespace/name for core v1 kinds).
deleting_since, finalizersWhen the object is being deleted, deleting_since is metadata.deletionTimestamp and finalizers lists any finalizers still on it. deleting_since is omitted when the object is not being deleted; finalizers is omitted when empty.
problemsAny of missing, changed, not_ready, and deleting (deleting replaces changed and not_ready). Empty when the object is fine.
not_checkedWhether a selected check could not run on the object.
❱ kix status shop
❱ kix status shop --check drift --check presence
❱ kix status shop --package web -o json
❱ kix status --context prod -q
CodeMeaning
0Every selected check passed. Objects that were not checked do not count.
1Kix could not answer: no connection to the cluster, no current deploy for the named cluster, no Kix cluster deployed on the Kubernetes cluster, a --package that matches no package, or a record that lists no objects and whose own object is gone.
2An object is missing, changed, not ready, or being deleted (including objects outside the current deploy), or a deploy has failed since the current deploy.

A command line Kix cannot use exits 1, including kix health, kix drift, and kix status --operator, which 0.10 removed. So 2 always means that kix status ran and found a problem.