Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Kustomize backend for Pants

This release targets Pants 2.31.0. Install it with pants-backend-kustomize==0.7.0 in [GLOBAL].plugins in pants.toml.

Warning This plugin is in development. No stability is guaranteed! Contributions welcome.

This backends implements targets for kustomize templates.

  • kustomize for overlaying state ontop of raw kubernetes files

Tool versions

The default is standalone Kustomize v5.8.3. Versions v5.7.1, v5.0.3, and v4.5.7 are also recorded for Linux/macOS on x86-64 and ARM64. Select one with --kustomize-tool-version=v4.5.7 or [kustomize-tool].version. Standalone Kustomize versions are independent of the Kustomize embedded in kubectl; older entries provide compatibility choices rather than a promise of ongoing upstream maintenance.

Planned and missing features

  • Key/secret/… generation from built artifacts

Targets

There’s currently one target.

kustomize

A code-generation target for converting a bundle of kubernetes files into a single multi-docuent YAML file with state injected from other Pants targets.

kustomize(
    name="kustomize",
    sources=[
        "deployment.yaml",
        "server.py",
        "service.yaml",
        "namespace.yaml",
		"kustomization.yaml",
    ],
    dependencies=[":bin"],
)
ArgumentMeaningDefault value
nameThe target nameSame as any other target, which is the directory name
sourcesResources used by this targetRequired
dependenciesTargets to package and pass to the build context, as well as bases[]
decsriptionA description of the target
tagsList of tags[]

For dependencies, the builder will replace labels in the kustomization.yaml with the path of the built package.