[root@master ~]# kubectl get ns
NAMESTATUS AGE
default Active 46d
kube-node-lease Active 46d
kube-public Active 46d
kube-system Active 46d
monitoring Terminating 46d
修改完成后,直接调用API接口会有报错如下
curl -k -H "Content-Type: application/json"-X PUT--data-binary @tmp.json https://127.0.0.1:6443/api/v1/namespaces/monitoring/finalize
{
"kind":"Status","apiVersion":"v1","metadata": {
},"status":"Failure","message": "namespaces \"monitoring\" is forbidden: User \"system:anonymous\" cannot update resource \"namespaces/finalize\" in API group \"\" in the namespace \"monitoring\"","reason":"Forbidden","details": {
"name":"monitoring","kind":"namespaces"
},"code":403