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)
Just re-create the namespace:
kubectl delete ns squad-mb
kubectl create ns squad-mb
This will recursively delete everything inside.
kubectl -n namespace delete all pods -l env=dev
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