Skip to content

Inspect an instance's deps, parts, and `out`

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

Use the CLI for the rendered resource inventory and dependency graph. Use nix eval when you need the package author’s raw parts or exported out attributes.

Start with kix inspect:

Run in kix-examples/
❱ kix inspect how-to-application Show output
Cluster: how-to-application
Total resources: 16

Namespaces (3):
  (cluster-scoped) (5 resources)
  how-to-app (10 resources)
  kube-system (1 resources)

Resource kinds:
 Kind                      Count 
 ConfigMap                 3     
 PackageInstance           3     
 CustomResourceDefinition  2     
 Deployment                2     
 Namespace                 2     
 Service                   2     
 Activation                1     
 Job                       1     

Resources:
  (cluster-scoped):
    Activation/how-to-application-gb5d6ry45b5l
    CustomResourceDefinition/activations.kix.run
    CustomResourceDefinition/packageinstances.kix.run
    Namespace/how-to-app
    Namespace/kube-system
  how-to-app:
    ConfigMap/preview
    ConfigMap/production
    ConfigMap/production-health-script
    Deployment/preview
    Deployment/production
    Job/production-health
    PackageInstance/preview
    PackageInstance/production
    Service/preview
    Service/production
  kube-system:
    PackageInstance/platform-dns

This output lists resources by namespace and kind. It does not show package parts, resolved dependency bindings, or out values.

Use kix graph to see the dependencies that affect deployment ordering:

Run in kix-examples/
❱ kix graph 08-namespace-deps --format tree Show output
CustomResourceDefinition/activations.kix.run
└── Activation/08-namespace-deps-8zzrakfr54y8
CustomResourceDefinition/packageinstances.kix.run
├── PackageInstance/backend@platform
│   └── Activation/08-namespace-deps-8zzrakfr54y8
├── PackageInstance/platform-dns@kube-system (import)
│   ├── Activation/08-namespace-deps-8zzrakfr54y8
│   └── Deployment/gateway@app
│       └── Service/gateway@app
│           └── PackageInstance/gateway@app
│               └── Activation/08-namespace-deps-8zzrakfr54y8
└── PackageInstance/gateway@app
    └── Activation/08-namespace-deps-8zzrakfr54y8
Namespace/app
├── Service/gateway@app
│   └── PackageInstance/gateway@app
│       └── Activation/08-namespace-deps-8zzrakfr54y8
├── ConfigMap/gateway@app
│   └── Deployment/gateway@app
│       └── Service/gateway@app
│           └── PackageInstance/gateway@app
│               └── Activation/08-namespace-deps-8zzrakfr54y8
├── PackageInstance/gateway@app
│   └── Activation/08-namespace-deps-8zzrakfr54y8
└── Deployment/gateway@app
    └── Service/gateway@app
        └── PackageInstance/gateway@app
            └── Activation/08-namespace-deps-8zzrakfr54y8
Namespace/kube-system
└── PackageInstance/platform-dns@kube-system (import)
    ├── Activation/08-namespace-deps-8zzrakfr54y8
    └── Deployment/gateway@app
        └── Service/gateway@app
            └── PackageInstance/gateway@app
                └── Activation/08-namespace-deps-8zzrakfr54y8
Namespace/platform
├── Service/backend@platform
│   ├── ConfigMap/gateway@app
│   │   └── Deployment/gateway@app
│   │       └── Service/gateway@app
│   │           └── PackageInstance/gateway@app
│   │               └── Activation/08-namespace-deps-8zzrakfr54y8
│   └── PackageInstance/backend@platform
│       └── Activation/08-namespace-deps-8zzrakfr54y8
├── 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-8zzrakfr54y8
│           └── PackageInstance/backend@platform
│               └── Activation/08-namespace-deps-8zzrakfr54y8
├── PackageInstance/backend@platform
│   └── Activation/08-namespace-deps-8zzrakfr54y8
└── Deployment/backend@platform
    └── Service/backend@platform
        ├── ConfigMap/gateway@app
        │   └── Deployment/gateway@app
        │       └── Service/gateway@app
        │           └── PackageInstance/gateway@app
        │               └── Activation/08-namespace-deps-8zzrakfr54y8
        └── PackageInstance/backend@platform
            └── Activation/08-namespace-deps-8zzrakfr54y8
15 resources, 24 dependencies

The graph is built from rendered manifests. It includes references carried by resource values and explicit requires or extraDeps edges. A package build argument by itself does not create an edge; the edge appears when a resource uses an output from that dependency.

Use JSON when you need to filter the graph by resource fields:

Run in kix-examples/
❱ kix graph how-to-application --format json | jq '.nodes[] | select(.namespace == "how-to-app" and .name == "production")'

buildCluster exposes evaluated instances under legacyPackages.<system>.kixClusters. The instance’s raw attribute is the parts attrset returned by its package build function.

List the parts without forcing every resource into JSON:

Run in kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --json ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: builtins.attrNames cluster.instances."how-to-app".production.raw'

For the example instance, the result includes content, deployment, service, healthCheck, and root. Use a quoted attribute name whenever a namespace or instance name contains a hyphen.

List the public values on the package root:

Run in kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --json ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: builtins.attrNames cluster.instances."how-to-app".production.out'

Then evaluate one serializable value directly:

Run in kix-examples/
❱ system=$(nix eval --impure --raw --expr builtins.currentSystem)
❱ nix eval --raw ".#legacyPackages.${system}.kixClusters.how-to-application" --apply 'cluster: cluster.instances."how-to-app".production.out.name'

Some out attributes are functions or carry Nix string context, so the whole attrset may not serialize. List its keys first, then evaluate the scalar value you need.