How-to guide / Operate a cluster
Export plain YAML
These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.
Use kix export when you need a directory of Kubernetes manifests without
Kix’s deployment records. By default, the export removes Kix annotations and
omits Activation and PackageInstance resources.
Export the cluster
Section titled “Export the cluster”Choose an output directory with --out:
❱ kix export how-to-application --out ./handoff
Building cluster 'how-to-application'...
Evaluating cluster 'how-to-application'...
Reading package index...
Loading store graph...
Reading 4 packages...
Computing cross-package dependencies...
Exported 10 resources to ./handoff (plain Kubernetes YAML)
Skipped 5 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:
❱ find handoff -type f | sort
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.
By default, kix export omits Activation and PackageInstance objects as
well as Kix’s annotations (pass --with-kix-metadata to keep them). Kix’s own
CustomResourceDefinitions are also absent from the export because builds do not
include them (Kix installs them directly on the cluster during deploys).
Review the export
Section titled “Review the export”Compare the files with a live cluster before handing them to another system:
❱ kubectl diff --server-side -R -f ./handoff/ The export strips all kix.run/* annotations from the exported manifests.
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.
Export again
Section titled “Export again”Kix refuses to write into an existing output directory. Remove or archive the
previous export, or pass --force when replacing it is intentional:
❱ 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.