Apply a kustomization and prune matching managed objects.
Section: Kustomize with kubectl
Apply and prune kustomization
bash
bash
kubectl apply -k overlays/prod --prune -l app.kubernetes.io/managed-by=kustomizeExplanation
Apply a kustomization and prune matching managed objects.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Kustomize with kubectl
Delete kustomized resources
Delete resources generated by a kustomization.
Generate configmap YAML dry-run
Generate YAML that can be committed into Kustomize overlays.