十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
今天给大家介绍一下删除ns后一直处于Terminating状态中该怎么办。文章的内容小编觉得不错,现在给大家分享一下,觉得有需要的朋友可以了解一下,希望对大家有所帮助,下面跟着小编的思路一起来阅读吧。
创新互联建站网站建设公司,提供做网站、成都网站设计,网页设计,建网站,PHP网站建设等专业做网站服务;可快速的进行网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,是专业的做网站团队,希望更多企业前来合作!
强制删除也是出现报错
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely. Error from server (Conflict): Operation cannot be fulfilled on namespaces "devtesting": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.

kubectl get namespace devtesting -o json > devtesting.json
# cat devtesting.json
{
"apiVersion": "v1",
"kind": "Namespace",
"metadata": {
"annotations": {
"cattle.io/status": "{\"Conditions\":[{\"Type\":\"ResourceQuotaInit\",\"Status\":\"True\",\"Message\":\"\",\"LastUpdateTime\":\"2019-09-23T07:24:02Z\"},{\"Type\":\"InitialRolesPopulated\",\"Status\":\"True\",\"Message\":\"\",\"LastUpdateTime\":\"2019-09-23T07:24:02Z\"}]}",
"lifecycle.cattle.io/create.namespace-auth": "true"
},
"creationTimestamp": "2019-09-23T07:23:03Z",
"deletionTimestamp": "2019-09-30T06:35:09Z",
"labels": {
"name": "devtesting"
},
"name": "devtesting",
"resourceVersion": "6153812",
"selfLink": "/api/v1/namespaces/devtesting",
"uid": "a00e013b-0066-4b64-915d-05acde5c9a09"
},
"spec": {
"finalizers": [
"kubernetes"
]
},
"status": {
"phase": "Terminating"
}
}删除其中的spec字段,因为k8s集群是携带认证的

执行以下curl命令,使用kube-apiserver的8080端口,执行删除操作
curl -k -H "Content-Type: application/json" -X PUT --data-binary @devtesting.json http://127.0.0.1:8080/api/v1/namespaces/devtesting/finalize


备注:
如果kube-apiserver未开非安全端口,可以手动创建一个代理会话,
# kubectl proxy --port=8081 # curl -k -H "Content-Type: application/json" -X PUT --data-binary @devtesting.json http://127.0.0.1:8081/api/v1/namespaces/test/finalize
以上就是删除ns后一直处于Terminating状态中该怎么办的全部内容了,更多与删除ns后一直处于Terminating状态中该怎么办相关的内容可以搜索创新互联之前的文章或者浏览下面的文章进行学习哈!相信小编会给大家增添更多知识,希望大家能够支持一下创新互联!