1 | initial version |
To remove a namespace in Kubernetes, follow these steps:
kubectl delete namespace <namespace name>
to delete the namespace. For example, kubectl delete namespace my-namespace
.kubectl get namespaces
. The deleted namespace should not appear in the list.Note: Before deleting a namespace, make sure there are no running pods, services or other resources associated with the namespace. You can use the command kubectl get pods, services, etc. --namespace <namespace name>
to list all the resources in a namespace.