Skip to content

Export plain YAML

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

Use kix export when you need a directory of Kubernetes manifests without Kix’s deployment records. The default export mode removes Kix annotations and omits Activation and PackageInstance resources.

Choose an output directory with --out:

Run in kix-examples/
❱ kix export how-to-application --out ./handoff
Building cluster 'how-to-application'...
  Evaluating cluster 'how-to-application'...
  Reading package index...
  Loading store graph...
  Reading 3 packages...
  Discovering cluster-level resources...
  Computing cross-package dependencies...

  Exported 12 resources to ./handoff (exit (kix-neutral))
  Skipped 4 kix-internal CRs (Activation, PackageInstance)

Kix evaluates and builds the cluster before writing the files. It does not connect to Kubernetes.

The output is grouped by namespace. Cluster-scoped resources are written under _cluster:

Run in kix-examples/
❱ find handoff -type f | sort
handoff/_cluster/CustomResourceDefinition-activations.kix.run.yaml
handoff/_cluster/CustomResourceDefinition-packageinstances.kix.run.yaml
handoff/_cluster/Namespace-how-to-app.yaml
handoff/_cluster/Namespace-kube-system.yaml
handoff/how-to-app/ConfigMap-preview.yaml
handoff/how-to-app/ConfigMap-production-health-script.yaml
handoff/how-to-app/ConfigMap-production.yaml
handoff/how-to-app/Deployment-preview.yaml
handoff/how-to-app/Deployment-production.yaml
handoff/how-to-app/Job-production-health.yaml
handoff/how-to-app/Service-preview.yaml
handoff/how-to-app/Service-production.yaml

Each filename contains the resource kind and name, such as how-to-app/Deployment-production.yaml.

Exit mode omits the Activation and PackageInstance objects, but includes the two CustomResourceDefinitions for those kinds. The CRDs are ordinary cluster-scoped resources in the graph, so they appear under _cluster. Remove them manually if the receiving system should contain no Kix resources.

Compare the files with a live cluster before handing them to another system:

Run in kix-examples/
❱ kubectl diff --server-side -R -f ./handoff/

Then confirm no Kix annotation survived the export. The search finds nothing and exits with status 1, which is the result you want here:

Run in kix-examples/
❱ grep -r 'kix.run/' ./handoff/

(exit code: 1)

That pattern matches annotation keys, where kix.run is followed by a slash. It does not match the CRD names, where kix.run appears as a bare suffix.

Labels such as app.kubernetes.io/managed-by remain part of the resource metadata, so review and adjust labels if the receiving system has its own ownership convention.

Kix refuses to write into an existing output directory. Remove or archive the previous export, or pass --force when replacing it is intentional:

Run in kix-examples/
❱ kix export how-to-application --out ./handoff --force

--force clears the output directory before writing the new export. This prevents stale YAML from recreating resources that have since been removed. For safety, Kix clears only a tree containing directories and .yaml files, which is the structure produced by an earlier export. If it finds any other file or a symbolic link, it reports the path and refuses to continue. Remove or relocate the directory yourself.