How-to guide Operate a cluster
Check cluster health
Verify that the active Kix dependency graph is intact on a Kubernetes cluster.
Use kix health to verify that every resource in the active activation can
still find the resources it depends on.
Check the active activation
Section titled “Check the active activation”Run health with the cluster name:
❱ kix health how-to-application
Connecting to cluster...
Activation: how-to-application-gb5d6ry45b5l (hash: gb5d6ry45b5ll664ahagxldh9na9z3y5)
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.
Read the package summary
Section titled “Read the package summary”Each package is assigned one of these states:
| State | Meaning |
|---|---|
healthy | Every required resource is present |
external | The package describes an imported resource |
completed | A run-to-completion resource finished and removed itself as declared |
DEGRADED | A required resource is missing |
AT RISK | The package depends directly or transitively on a broken resource |
Run with -vv when you need to see the dependency traversal:
❱ kix health how-to-application -vv Show outputHide output · 38 lines
0.000534602s DEBUG kix::eval::evaluator: evaluator created (no cache) flake=kix-examples
Connecting to cluster...
0.009769326s DEBUG kix::cluster::fetch: apiserver reachable endpoint="https://127.0.0.1:45701/" version=v1.35.0
0.027658882s DEBUG kix::cluster::fetch: API resources discovered count=60
0.034758308s DEBUG kix::cluster::fetch: fetched resource=endpoints count=2
0.037402015s DEBUG kix::cluster::fetch: fetched resource=configmaps count=3
0.038155564s DEBUG kix::cluster::fetch: fetched resource=customresourcedefinitions.apiextensions.k8s.io count=2
0.038398331s DEBUG kix::cluster::fetch: fetched resource=namespaces count=2
0.040873132s DEBUG kix::cluster::fetch: fetched resource=deployments.apps count=2
0.041233822s DEBUG kix::cluster::fetch: fetched resource=packageinstances.kix.run count=3
0.041741031s DEBUG kix::cluster::fetch: fetched resource=activations.kix.run count=1
0.043002185s DEBUG kix::cluster::fetch: fetched resource=jobs.batch count=1
0.079261687s DEBUG kix::cluster::fetch: fetched resource=services count=2
0.079562532s DEBUG kix::cluster::fetch: fetched resource=endpointslices.discovery.k8s.io count=2
Activation: how-to-application-gb5d6ry45b5l (hash: gb5d6ry45b5ll664ahagxldh9na9z3y5)
16 kix-managed resources on cluster
→ checking PackageInstance/preview@how-to-app (84pfjn0k)
→ checking Deployment/production@how-to-app (kr7i34wz)
→ checking ConfigMap/preview@how-to-app (asa4ywz8)
→ checking Service/preview@how-to-app (91lbws8g)
→ checking ConfigMap/production@how-to-app (4x75h2z7)
→ checking CustomResourceDefinition/packageinstances.kix.run (pk4hih6j)
→ checking Namespace/kube-system (sj0fv5bs)
→ checking Deployment/preview@how-to-app (hd2br513)
→ checking PackageInstance/production@how-to-app (avvdnz5y)
→ checking Job/production-health@how-to-app (67bgr7gg)
→ checking CustomResourceDefinition/activations.kix.run (gvrlspcf)
→ checking Namespace/how-to-app (8767b7nz)
→ checking ConfigMap/production-health-script@how-to-app (dlzbv1na)
→ checking Activation/how-to-application-gb5d6ry45b5l (gb5d6ry4)
→ checking Service/production@how-to-app (cd3l507f)
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) Select a Kubernetes context
Section titled “Select a Kubernetes context”Pass --context when the cluster is not on the current kubectl context:
❱ 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.