Kustomize

Deploying with kustomize

kustomize allows Kubernetes developers to customize raw, template-free YAML files for multiple purposes. Skaffold can work with kustomize by calling its command-line interface.

Configuration

To use kustomize with Skaffold, add deploy type kustomize to the deploy section of skaffold.yaml.

The kustomize type offers the following options:

Option Description Default
paths path to Kustomization files. ["."]
flags additional flags passed to kubectl.
buildArgs additional args passed to kustomize build. []
defaultNamespace default namespace passed to kubectl on deployment if no other override is given.
hooks describes a set of lifecycle hooks that are executed before and after every deploy.

Each entry in paths should point to a folder with a kustomization file.

flags section offers the following options:

Option Description Default
global additional flags passed on every command. []
apply additional flags passed on creations (kubectl apply). []
delete additional flags passed on deletions (kubectl delete). []
disableValidation passes the --validate=false flag to supported kubectl commands when enabled. false

Example

The following deploy section instructs Skaffold to deploy artifacts using kustomize:

deploy:
  kustomize: {}
# The deploy section above is equal to
# deploy:
#   kustomize:
#     paths: ["."]