Skip to content

Check cluster health

This content is for the v0.1 version. Switch to the latest version for up-to-date documentation.

Use kix health to verify that every resource in the active activation can still find the resources it depends on.

Run health with the cluster name:

Run in kix-examples/
❱ kix health how-to-application
Connecting to cluster...
Activation: how-to-application-aq1zdgf9gsnb (hash: aq1zdgf9gsnbdpc8hwkma69l8ipalqpx)
16 kix-managed resources on cluster

Packages:
  ✓ (cluster-level)                          7/7 resources healthy, 1 imported
  ✓ preview (how-to-app)                     3/3 resources healthy
  ✓ production (how-to-app)                  5/5 resources healthy

Health: 15 in-sync, 1 imported (3/3 packages healthy)

Kix reads the active activation and its managed resources directly from Kubernetes. It then follows their dependency identities and reports a summary for each package instance.

A healthy result exits with status 0. A missing dependency or a resource that depends on one exits with status 1.

Each package is assigned one of these states:

StateMeaning
healthyEvery required resource is present
externalThe package describes an imported resource
completedA run-to-completion resource finished and removed itself as declared
DEGRADEDA required resource is missing
AT RISKThe package depends directly or transitively on a broken resource

Run with -vv when you need to see the dependency traversal:

Run in kix-examples/
❱ kix health how-to-application -vv Show output
   0.000240459s DEBUG kix::eval::evaluator: evaluator created (no cache) flake=kix-examples
Connecting to cluster...
   0.010317125s DEBUG kix::cluster::fetch: API resources discovered count=60
   0.017008792s DEBUG kix::cluster::fetch: fetched resource=jobs.batch count=1
   0.017524125s DEBUG kix::cluster::fetch: fetched resource=endpointslices.discovery.k8s.io count=2
   0.018167667s DEBUG kix::cluster::fetch: fetched resource=activations.kix.run count=1
   0.018211834s DEBUG kix::cluster::fetch: fetched resource=packageinstances.kix.run count=3
   0.018262459s DEBUG kix::cluster::fetch: fetched resource=deployments.apps count=2
   0.018871459s DEBUG kix::cluster::fetch: fetched resource=configmaps count=3
   0.018926417s DEBUG kix::cluster::fetch: fetched resource=endpoints count=2
   0.019647459s DEBUG kix::cluster::fetch: fetched resource=namespaces count=2
   0.020423334s DEBUG kix::cluster::fetch: fetched resource=services count=2
   0.020473459s DEBUG kix::cluster::fetch: fetched resource=customresourcedefinitions.apiextensions.k8s.io count=2
Activation: how-to-application-aq1zdgf9gsnb (hash: aq1zdgf9gsnbdpc8hwkma69l8ipalqpx)
16 kix-managed resources on cluster
  → checking ConfigMap/preview@how-to-app (asa4ywz8)
  → checking Job/production-health@how-to-app (jlh9mhs2)
  → checking PackageInstance/production@how-to-app (wzlnh3jn)
  → checking CustomResourceDefinition/activations.kix.run (gvrlspcf)
  → checking Service/production@how-to-app (2yvr6bbd)
  → checking CustomResourceDefinition/packageinstances.kix.run (pk4hih6j)
  → checking Namespace/how-to-app (8767b7nz)
  → checking Service/preview@how-to-app (y6f6a4cr)
  → checking ConfigMap/production@how-to-app (4x75h2z7)
  → checking PackageInstance/preview@how-to-app (q9w5514x)
  → checking Deployment/production@how-to-app (22q0r4mc)
  → checking Namespace/kube-system (sj0fv5bs)
  → checking ConfigMap/production-health-script@how-to-app (dlzbv1na)
  → checking Deployment/preview@how-to-app (cc7cm00b)
  → checking Activation/how-to-application-aq1zdgf9gsnb (aq1zdgf9)

Packages:
  ✓ (cluster-level)                          7/7 resources healthy, 1 imported
  ✓ preview (how-to-app)                     3/3 resources healthy
  ✓ production (how-to-app)                  5/5 resources healthy

Health: 15 in-sync, 1 imported (3/3 packages healthy)

Pass --context when the cluster is not on the current kubectl context:

Run in kix-examples/
❱ kix health how-to-application --context kind-kix-demo

health checks the active dependency graph already recorded in Kubernetes. It does not evaluate the local cluster definition, compare manifest fields, or test workload readiness.