How-to guide / Operate a cluster
Check a cluster's status
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Use kix status to check a cluster after a deploy, or at any time later. For
every object of the cluster’s last deploy, it checks three things: the object
is on the cluster, it still holds what Kix applied, and it is ready.
kix status does not build the cluster definition, so you can run it from any
directory, even on a machine without the project repository. Inside the project,
pass the cluster’s name from flake.nix (or its deployed name, if the cluster
definition sets a different one). Outside the project, pass the deployed name.
Check the cluster
Section titled “Check the cluster”Run the command with the cluster name:
❱ kix status how-to-application When everything is in order, the output looks like this:
1Cluster how-to-application on Kubernetes v1.35.0 (context kind-kix-demo)2Last deploy: how-to-application-6rhi3wpk9iml Active 2m ago3
4 how-to-app/preview 4 resources ok5 how-to-app/production 6 resources ok6 kube-system/platform-dns 1 resource ok7 kube-system/platform-storage 1 resource ok8 (cluster-level) 4 resources ok9
1016 resources: 16 ok.Kix reads the Kubernetes cluster of the current kubectl context. Pass
--context to read another one:
❱ kix status how-to-application --context kind-kix-demo Leave out the cluster name to check every Kix cluster that has deployed to that Kubernetes cluster.
Read the package lines
Section titled “Read the package lines”The output has one line for each package, named namespace/instance, with
the number of objects the package deployed. Objects that belong to no
package, such as Namespaces and CustomResourceDefinitions, are counted under
(cluster-level).
A package line reads ok or counts its problems: missing, changed, or
not ready. Below the package lines, Kix lists each object with a problem,
grouped by package. Add -v to list every object:
❱ kix status how-to-application -v Add -q to print only the objects with a problem, or --package production
to look at one package.
Find missing objects
Section titled “Find missing objects”An object is missing when the last deploy made it and it is gone from the
cluster, for example after someone ran kubectl delete:
1 how-to-app/production 6 resources 1 missing2
3how-to-app/production4 ConfigMap how-to-app/production missing, needed by Deployment how-to-app/production5
616 resources: 15 ok, 1 missing.7Next: run `kix deploy how-to-application` to restore what is missing or changed, or `kix plan how-to-application` to preview the changes first.The line names the objects that depend on the missing one. Those objects may keep running, but can fail when they next need it, for example when a Pod restarts and mounts the ConfigMap.
Run kix deploy (shown on the Next: line) to recreate the missing object.
kix deploy always recreates any object in the build that is missing from the
cluster.
When Kix cannot determine a missing object’s kind and name, it shows
Unknown/(hash: ...). This happens on a machine that does not have the
deployed build locally when an earlier version of Kix wrote the deployment
record without object names and no deploy on this version has converted it yet.
Find changed objects
Section titled “Find changed objects”An object is changed when a field Kix applied no longer holds the value Kix applied. Kix reads the object’s field ownership data to say which field changed and which tool changed it. To run only this check:
❱ kix status how-to-application --check drift In this example, someone scaled the production Deployment from two replicas
to one with kubectl scale:
1Cluster how-to-application on Kubernetes v1.35.0 (context kind-kix-demo)2Last deploy: how-to-application-6rhi3wpk9iml Active 5m ago3
4 how-to-app/preview 4 resources ok5 how-to-app/production 6 resources 1 changed6 kube-system/platform-dns 1 resource ok7 kube-system/platform-storage 1 resource ok8 (cluster-level) 4 resources ok9
10how-to-app/production11 Deployment how-to-app/production changed since deploy (spec.replicas by kubectl)12
1316 resources: 15 ok, 1 changed.14Next: run `kix deploy how-to-application` to restore what is missing or changed, or `kix plan how-to-application` to preview the changes first. The deploy takes back the fields that kubectl owns.Only the fields Kix set count. A field that a controller adds, or one the package cedes to a controller, does not make the object changed.
Before you put the value back, decide whether the change should stay. If it should, change the cluster definition to match and deploy. If it should not, follow Reconcile drift.
An object with no recorded applied hash shows as “not checked for changes”.
The next kix deploy reapplies the object and records its applied hash. Objects that are not checked do not
count as problems.
Investigate an object that is not ready
Section titled “Investigate an object that is not ready”An object is not ready when it fails the readiness rules kix deploy waits
on. The line says why:
1how-to-app/production2 Deployment how-to-app/production not ready (1/2 ready, 2/2 updated)kix status gives a summary. To find the cause, use kubectl:
- Note the object’s kind, namespace, and name from the output.
- Inspect it with
kubectl describe. - Read Pod or Job logs where they apply.
For example:
❱ kubectl describe deployment production -n how-to-app Show outputHide output · 52 lines
Name: production
Namespace: how-to-app
CreationTimestamp: Fri, 27 Nov 2026 10:37:05 +0000
Labels: app.kubernetes.io/instance=production
app.kubernetes.io/managed-by=kix
app.kubernetes.io/name=production
Annotations: deployment.kubernetes.io/revision: 1
kix.run/depends-on: 4x75h2z7rsj3dvrdg9vzqc8l789xvm4w,8767b7nzgc1x5bpfa9gv71cpk9z8h0iw
kix.run/identity-hash: kr7i34wz1ja58c0vf9gizx8161ji0idk
kix.run/package: production
kix.run/package-namespace: how-to-app
Selector: app.kubernetes.io/instance=production,app.kubernetes.io/name=production
Replicas: 2 desired | 2 updated | 2 total | 2 available | 0 unavailable
StrategyType: RollingUpdate
MinReadySeconds: 0
RollingUpdateStrategy: 25% max unavailable, 25% max surge
Pod Template:
Labels: app.kubernetes.io/instance=production
app.kubernetes.io/name=production
Containers:
nginx:
Image: docker.io/library/nginx:1.27-alpine
Port: 80/TCP (http)
Host Port: 0/TCP (http)
Limits:
memory: 64Mi
Requests:
cpu: 10m
memory: 16Mi
Readiness: http-get http://:http/ delay=0s timeout=1s period=10s #success=1 #failure=3
Environment:
APP_ENV: production
Mounts:
/usr/share/nginx/html from content (ro)
Volumes:
content:
Type: ConfigMap (a volume populated by a ConfigMap)
Name: production
Optional: false
Node-Selectors: <none>
Tolerations: <none>
Conditions:
Type Status Reason
---- ------ ------
Available True MinimumReplicasAvailable
Progressing True NewReplicaSetAvailable
OldReplicaSets: <none>
NewReplicaSet: production-85577f7474 (2/2 replicas created)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal ScalingReplicaSet 52s deployment-controller Scaled up replica set production-85577f7474 from 0 to 2 The health-check Job’s logs say whether the post-deploy probe passed:
❱ kubectl logs job/production-health -n how-to-app
ok GET http://production.how-to-app.svc.cluster.local:80 When the last deploy failed
Section titled “When the last deploy failed”When a deploy fails, the previous deploy stays active. kix status shows the
failed deploy first, along with when and why it failed, followed by the current
deploy. Any objects that belong only to the failed deploy appear under
Only in the failed deploy, and kix status exits 2 until a new deploy
succeeds. Fix the cause of the failure and run kix deploy again.
What readiness does not show
Section titled “What readiness does not show”Kix checks the status that Kubernetes and cluster controllers report for each
object. A Deployment is ready when its pods are updated and pass their
readiness probes. A LoadBalancer Service is ready once its load balancer
gives it an address. A custom resource is ready when its controller sets the
ready state its package declares. Because Kix does not test the external
services your pods call, every object can report ready while part of a workload
is failing:
-
Rejected cloud identities. A pod can start and pass its readiness probes even if the cloud provider rejects its identity. Only its requests to cloud APIs fail, for example when an IAM role is missing permissions or when a trust policy or Workload Identity binding names the wrong ServiceAccount. Check the pod logs for errors such as
AccessDeniedor403. -
Operator features reported in separate conditions. An operator can mark a custom resource ready while one of its features is failing. For example, a CloudNativePG
ClusterstaysReady=Truewhen archiving to its backup store fails, and reports the failure in itsContinuousArchivingcondition instead:Terminal window 1kubectl get cluster.postgresql.cnpg.io <name> -n <namespace> \2-o jsonpath='{.status.conditions[?(@.type=="ContinuousArchiving")]}'
Use the check in a script
Section titled “Use the check in a script”kix status exits with a code a script or a cron job can branch on:
| Code | Meaning |
|---|---|
0 | Every selected check passed. |
2 | An object is missing, changed, or not ready. |
1 | Kix could not answer, for example because it could not reach the cluster or the cluster has no deploy. |
Pass --check to run only the checks you care about. Repeat it to run more
than one. For example, to alert when an object is gone or someone changed one:
❱ kix status how-to-application --check presence --check drift -q Objects that Kix could not check do not change the exit code. For example, when the account may not list Secrets, Kix says so on a closing line and leaves those objects unchecked.
To store the result or read it with another program, use JSON:
❱ kix status how-to-application --check drift -o json > status.json The document lists every object with its problems, and has a summary with
counts. See kix status
for every field.
kix status only reads. It does not apply anything or change the cluster’s
Activation records.