hardkubectl
Apply all manifests in a directory and delete labelled resources not present in the directory
command
kubectl apply --prune -f DIRECTORY -l APP=LABELalso accepted
kubectl apply --prunecommand
kubectl apply --prune -f DIRECTORY -l APP=LABELalso accepted
kubectl apply --prunePart of the Kubernetes CLI (kubectl) — Resource Operations category.
| Flag | Purpose |
|---|---|
--prune | Boolean flag |
-f | Boolean flag |
-l | Boolean flag |
Test your recall — not just your reading.
Practice with interactive quiz →