Reputation: 1958
what is the command to remove all objects using kubectl for a specific environment?
kubectl -n squad-mb get all
returns all environments for example, and in order to delete one environment I would like to know how to see it, and which command would be required to delete the specific environment (i.e. develop)
Upvotes: 3
Views: 3937
Reputation: 8892
To delete all resources of a given namespaces use:
kubectl delete all --all -n {my-namespace}
Explanation:
kubectl delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)]) [options]
kubectl delete deployments,pods,replicasets,services --all
kubectl delete pods --all
Upvotes: 10
Reputation: 6040
Just re-create the namespace:
kubectl delete ns squad-mb
kubectl create ns squad-mb
This will recursively delete everything inside.
Upvotes: 0