kustomization.yaml using the kustomize edit subcommands. Anything you normally declare in YAML—adding or removing labels, prefixes, namespaces, modifying images or replica counts—can also be done directly via the CLI.
Before you start, check the help output for available subcommands:
Key Subcommands
| Subcommand | Action |
|---|---|
edit set | Modify existing fields |
edit add | Add generators, resources, or plugins |
edit remove | Remove items from the kustomization |
edit set
Usekustomize edit set to change fields in your kustomization.yaml without editing it by hand.
Change an image tag
Set or update a namespace
This command only updates your
kustomization.yaml. It does not apply changes to your cluster.Add common labels
Set replica count for a Deployment
edit add
Theadd subcommands let you generate ConfigMaps, Secrets, and include additional resources.
Add a ConfigMap generator
Add a Secret generator
Add a resource
Include external YAML manifests in your kustomization:Which kustomization.yaml Gets Updated?
If your project uses multiple overlays or bases, the file modified depends on where you run the command:
kustomization.yaml in your current directory, you’ll see an error.