Skip to main content
When you run kustomize build, it compiles all resource manifests along with their specified transformations and prints them to stdout. However, this command alone does not apply these configurations to your Kubernetes cluster. If you immediately check your cluster with:
you will see that no resources have been created yet.

Applying Resources

There are two common ways to apply the manifests generated by Kustomize:
  1. Piping the output into kubectl apply:
    Example output:
  2. Using kubectl’s native Kustomize support with the -k flag:
    Example output:
Using kubectl apply -k automatically detects your kustomization.yaml file in the specified directory—no need to pipe output manually.

Command Reference Table

Deleting Resources

To remove the same set of resources you applied, replace apply with delete in either approach:
  1. Piping into kubectl delete:
    Example output:
  2. Using kubectl delete -k:
    Example output:
Deleting resources is irreversible. Make sure you’re targeting the correct environment and namespace before running kubectl delete.

Further Reading

Watch Video