Skip to main content
Version: Deploy Next

Using XL CLI with Kustomize Overlays

The XL CLI can generate its Kubernetes manifests into a Kustomize base directory, letting you keep your environment-specific changes in a separate overlay directory. This keeps your customizations cleanly separated from the generated default configuration, so you can regenerate the base for a new product version without losing your overrides.

Directory Structure

  • base/: generated and updated by the XL CLI. Do not hand-edit this directory, because it is overwritten on each generate or upgrade.
  • overlay/: your customizations and overrides of the default configuration. This is preserved across regenerations.
my-setup/
├── base/ # XL CLI generates and updates this
│ ├── kustomization.yaml
│ └── ...generated manifests...
└── overlay/ # your overrides live here
└── kustomization.yaml

The base configuration is driven by a prepared answers file.

Generating the Base

Use xl kube install / xl kube upgrade with --dry-run to generate manifests, then place them in the base directory. When a new product version is released, re-run generation to refresh the base directory while your overlay stays untouched.

Applying with an Overlay

# Preview the merged result
kubectl kustomize ./my-setup/overlay

# Apply via xl kube apply
xl kube apply -f ./my-setup/overlay -n <namespace> --server-type deploy

See XL Kube Command Reference for the xl kube apply command.