> For the complete documentation index, see [llms.txt](https://renhongcai.gitbook.io/kubernetes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://renhongcai.gitbook.io/kubernetes/di-jiu-zhang-zhun-ru-kong-zhi-qi/9.1-zhun-ru-kong-zhi-qi-gai-shu/9.1.2-nei-zhi-mo-ren-qi-dong-de-cha-jian/1.2.1-admissioncontroller_namespacelifecycle.md).

# 9.1.2.1 NamespaceLifecycle

`NamespaceLifecycle`是一款内置且默认启用的准入控制器插件，其主要职责如下： 1. 阻止系统预留的namespace（`default`、`kube-system`和`kube-public`）被删除； 2. 阻止在不存在的namespace中创建资源； 3. 阻止在处于删除过程中的namespace中创建资源；

其中前两条职责比较容易理解，第三条职责主要是为了配合其他控制器工作。当一个namespace被删除时， 该namespace中的所有资源都会被清理（级连删除），这往往会耗费较长的时间， 在这期间namespace对象会处于`Terminating`状态(status.phase值为“Terminating”)，为了不影响其他控制器清理资源， 所以当namespace处于删除过程中时，禁止再创建资源。
