Skip to content
kix /docs
Install the CLI

How-to guide Debug dependency wiring

Visualize the dependency graph with kix graph

Inspect resource ordering in a Kix cluster as a tree, DOT graph, or JSON.

Use kix graph to inspect dependencies in the rendered cluster. The graph includes references carried by resource manifests and explicit requires or extraDeps edges. It does not need access to Kubernetes.

Tree output is the quickest way to inspect ordering in a terminal:

kix-examples/ offline capture
❱ kix graph 08-namespace-deps --format tree
Show outputHide output · 70 lines
CustomResourceDefinition/activations.kix.run
└── Activation/08-namespace-deps-y50i580sy41b
CustomResourceDefinition/packageinstances.kix.run
├── PackageInstance/backend@platform
│   └── Activation/08-namespace-deps-y50i580sy41b
├── PackageInstance/platform-storage@kube-system (import)
│   └── Activation/08-namespace-deps-y50i580sy41b
├── PackageInstance/platform-dns@kube-system (import)
│   ├── Activation/08-namespace-deps-y50i580sy41b
│   └── Deployment/gateway@app
│       └── Service/gateway@app
│           └── PackageInstance/gateway@app
│               └── Activation/08-namespace-deps-y50i580sy41b
└── PackageInstance/gateway@app
    └── Activation/08-namespace-deps-y50i580sy41b
Namespace/app
├── Service/gateway@app
│   └── PackageInstance/gateway@app
│       └── Activation/08-namespace-deps-y50i580sy41b
├── ConfigMap/gateway@app
│   └── Deployment/gateway@app
│       └── Service/gateway@app
│           └── PackageInstance/gateway@app
│               └── Activation/08-namespace-deps-y50i580sy41b
├── PackageInstance/gateway@app
│   └── Activation/08-namespace-deps-y50i580sy41b
└── Deployment/gateway@app
    └── Service/gateway@app
        └── PackageInstance/gateway@app
            └── Activation/08-namespace-deps-y50i580sy41b
Namespace/kube-system
├── PackageInstance/platform-storage@kube-system (import)
│   └── Activation/08-namespace-deps-y50i580sy41b
└── PackageInstance/platform-dns@kube-system (import)
    ├── Activation/08-namespace-deps-y50i580sy41b
    └── Deployment/gateway@app
        └── Service/gateway@app
            └── PackageInstance/gateway@app
                └── Activation/08-namespace-deps-y50i580sy41b
Namespace/platform
├── Service/backend@platform
│   ├── ConfigMap/gateway@app
│   │   └── Deployment/gateway@app
│   │       └── Service/gateway@app
│   │           └── PackageInstance/gateway@app
│   │               └── Activation/08-namespace-deps-y50i580sy41b
│   └── PackageInstance/backend@platform
│       └── Activation/08-namespace-deps-y50i580sy41b
├── ConfigMap/backend@platform
│   └── Deployment/backend@platform
│       └── Service/backend@platform
│           ├── ConfigMap/gateway@app
│           │   └── Deployment/gateway@app
│           │       └── Service/gateway@app
│           │           └── PackageInstance/gateway@app
│           │               └── Activation/08-namespace-deps-y50i580sy41b
│           └── PackageInstance/backend@platform
│               └── Activation/08-namespace-deps-y50i580sy41b
├── PackageInstance/backend@platform
│   └── Activation/08-namespace-deps-y50i580sy41b
└── Deployment/backend@platform
    └── Service/backend@platform
        ├── ConfigMap/gateway@app
        │   └── Deployment/gateway@app
        │       └── Service/gateway@app
        │           └── PackageInstance/gateway@app
        │               └── Activation/08-namespace-deps-y50i580sy41b
        └── PackageInstance/backend@platform
            └── Activation/08-namespace-deps-y50i580sy41b
16 resources, 27 dependencies

The tree starts with resources that have no dependencies. Each indented entry depends on the resource above it. In this example, the gateway ConfigMap appears beneath Service/backend@platform, showing the edge across the namespace boundary.

If an expected edge is missing, check that the consumer reads a value from the dependency, such as backend.out.url { } or backend.out.name. That reference creates the edge. If there is no value to read, add the dependency to requires or extraDeps.

deps alone does not create an edge. It binds a package build argument to a provider. An edge appears only when the rendered resource uses a value from that provider.

Use DOT output for Graphviz or another graph viewer:

kix-examples/ offline capture
❱ kix graph 08-namespace-deps --format dot
Show outputHide output · 50 lines
digraph kix {
  rankdir=LR;
  node [shape=box];

  "0" [label="CustomResourceDefinition/activations.kix.run"];
  "1" [label="CustomResourceDefinition/packageinstances.kix.run"];
  "2" [label="Deployment/gateway@app"];
  "3" [label="Deployment/backend@platform"];
  "4" [label="Activation/08-namespace-deps-y50i580sy41b"];
  "5" [label="PackageInstance/gateway@app"];
  "6" [label="PackageInstance/platform-dns@kube-system (import)" style=dashed color=gray];
  "7" [label="PackageInstance/platform-storage@kube-system (import)" style=dashed color=gray];
  "8" [label="PackageInstance/backend@platform"];
  "9" [label="ConfigMap/gateway@app"];
  "10" [label="ConfigMap/backend@platform"];
  "11" [label="Namespace/app"];
  "12" [label="Namespace/kube-system"];
  "13" [label="Namespace/platform"];
  "14" [label="Service/gateway@app"];
  "15" [label="Service/backend@platform"];

  "2" -> "9";
  "2" -> "11";
  "2" -> "6";
  "3" -> "10";
  "3" -> "13";
  "4" -> "5";
  "4" -> "6";
  "4" -> "7";
  "4" -> "8";
  "4" -> "0";
  "5" -> "14";
  "5" -> "11";
  "5" -> "1";
  "6" -> "12";
  "6" -> "1";
  "7" -> "12";
  "7" -> "1";
  "8" -> "13";
  "8" -> "15";
  "8" -> "1";
  "9" -> "15";
  "9" -> "11";
  "10" -> "13";
  "14" -> "2";
  "14" -> "11";
  "15" -> "3";
  "15" -> "13";
}
16 resources, 27 dependencies

Redirect it into a file and render it with Graphviz:

kix-examples/
❱ kix graph 08-namespace-deps --format dot > kix-graph.dot
❱ dot -Tsvg kix-graph.dot > kix-graph.svg

The second command requires Graphviz. The generated SVG is useful when a tree is too deep to scan comfortably.

Use JSON when another tool will inspect the nodes and edges:

kix-examples/ output excerpt
❱ kix graph 08-namespace-deps --format json
{
  "nodes": 16,
  "edges": 27,
  "sample": {
    "id": "CustomResourceDefinition/activations.kix.run",
    "identityHash": "gvrlspcfgh9a2qnsx5kqxw9f4l3x52jj",
    "isImport": false,
    "kind": "CustomResourceDefinition",
    "name": "activations.kix.run",
    "namespace": "_cluster"
  }
}
16 resources, 27 dependencies

The excerpt above counts the nodes and edges and shows one node. Every node carries its kind, name, namespace, and identity hash, so another tool can join the graph to the rendered manifests.

Choose JSON for automation, not as the default way to read the graph by hand.