LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

flux-build

Build Flux manifests locally for inspection or piping to kubectl

TLDR

Build a Kustomization and print the resulting manifests
$ flux build kustomization my-app --path ./path/to/local/manifests
copy
Build using a local Flux Kustomization file without applying cluster state
$ flux build kustomization my-app --path ./path/to/local/manifests --kustomization-file ./my-app.yaml --dry-run
copy
Build and apply directly
$ flux build kustomization my-app --path ./kustomize | kubectl apply -f -
copy
Package manifests into an artifact tarball
$ flux build artifact --path ./path/to/local/manifests --output ./artifact.tgz
copy

SYNOPSIS

flux build kustomization name --path path [options]flux build artifact --path path [options]

DESCRIPTION

flux build renders Flux resources locally using controller-compatible logic, without applying them to the cluster. Supported subcommands are kustomization and artifact.flux build kustomization fetches (or loads) a Flux Kustomization, applies its transformations against the local manifests at `--path`, and writes the resulting multi-doc YAML to stdout. Useful for previewing deploys, debugging overlays, or piping to `kubectl`.flux build artifact packs a directory or single manifest file into a `.tgz` artifact suitable for source/OCI workflows.

PARAMETERS

kustomization name

Build the named Flux Kustomization against local manifests.
artifact
Build a tarball from local Kubernetes manifests.
-n, --namespace ns
Namespace scope (default `flux-system`).
--timeout duration
Timeout for the operation (default `5m0s`).
--path path (kustomization and artifact)
Path to local manifests / kustomization directory, or a single file for artifact builds.
--kustomization-file file
Path to a local Flux Kustomization YAML instead of fetching it from the cluster.
--dry-run
Dry-run mode without connecting to the cluster. Variable substitutions from Secrets and ConfigMaps are skipped.
--recursive, -r
Recursively build encountered Kustomizations.
--local-sources Kind/namespace/name=path,...
Map remote sources to local paths for recursive builds (e.g. `GitRepository/flux-system/my-repo=./path/to/local/git`).
--ignore-paths patterns
Comma-separated `.gitignore`-style paths to exclude.
--strict-substitute
Fail post-build substitution when a declared variable has no default and is missing from input vars.
--in-memory-build
Use an in-memory filesystem during the build (kustomization).
-o, --output file
Output path for the artifact tarball (default `artifact.tgz`).
--resolve-symlinks
Resolve symlinks by copying their targets into the artifact.

SEE ALSO

RESOURCES

Copied to clipboard
Kai