LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

kubectl-kustomize

Build a kustomization target from a directory or URL

TLDR

Build kustomization from current directory
$ kubectl kustomize
copy
Build kustomization from directory
$ kubectl kustomize [directory]
copy
Build and output to file
$ kubectl kustomize [directory] -o [output.yaml]
copy
Build with Helm chart support
$ kubectl kustomize --enable-helm [directory]
copy
Build from a remote URL
$ kubectl kustomize [https://github.com/user/repo/config]
copy
Apply kustomization directly
$ kubectl apply -k [directory]
copy

SYNOPSIS

kubectl kustomize [directory] [options]

DESCRIPTION

kubectl kustomize builds a set of KRM (Kubernetes Resource Model) resources from a directory containing a kustomization.yaml file, or from a git repository URL with a path suffix. If the directory argument is omitted, the current directory is assumed. Processes patches, overlays, and resource modifications without templates. Output can be piped to kubectl apply.

PARAMETERS

--enable-helm

Enable Helm chart rendering.
--helm-command STRING
Helm command path (default: "helm").
--load-restrictor STRING
Control resource loading restrictions (default: LoadRestrictionsRootOnly). Set to LoadRestrictionsNone to allow loading from outside root.
--reorder STRING
Reorder resources before output: "legacy" or "none" (default: "legacy").
-o, --output STRING
Write output to this file path.
--enable-alpha-plugins
Enable kustomize plugins.

SEE ALSO

Copied to clipboard
Kai