Skip to main content

Understanding Immortal Namespaces in Kubernetes

Bibin Wilson

The default namespace in Kubernetes cannot be deleted because it's a fundamental part of the system.

The logic for preventing the deletion of the default namespace is implemented in the Kubernetes source code.

Specifically, this logic is found in the Kubernetes API server. When a request is made to delete a namespace, the API server checks if the namespace is one of the system namespaces (such as default, kube-system, or kube-public). If it is, the API server denies the request.

Here’s an overview of where this logic is implemented: