Forrest logo
back to the kustomize tool

kustomize:tldr:ad2a8

kustomize: Build kustomization file and deploy it with `kubectl`.
$ kustomize build . | kubectl apply -f -
try on your machine

This command performs two operations:

  1. kustomize build .: This command uses kustomize tool to build the configuration based on the files and directories present in the current directory (.). kustomize is a configuration management tool that allows you to generate customized Kubernetes manifests dynamically.

  2. | kubectl apply -f -: The vertical bar | is a pipe operator that is used to redirect the output of the previous command to the next command. In this case, it redirects the output of kustomize build . to the kubectl apply command.

kubectl apply command is used to apply or update Kubernetes resources defined in a manifest file. The -f flag specifies that the resources to be applied are in the following file. The - (dash) represents the standard input or output. By using - after the -f flag, it tells kubectl apply to read the resource definition from the standard input.

So, when running this command, the output generated by kustomize build . is piped as input to kubectl apply -f -, which then applies the generated Kubernetes resources to the cluster.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the kustomize tool