我遇到了 Kubernetes 命名空间陷入“终止”状态的问题。运行会kubectl get ns cattle-monitoring-system -o json|jq
产生与命名空间状态相关的错误消息custom.metrics.k8s.io/v1beta1
,并显示DiscoveryFailed
命名空间状态中的条件:
E1213 08:02:39.979034 953148 memcache.go:287] couldn't get resource list for custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request
…
{
"apiVersion": "v1",
"kind": "Namespace",
…
"status": {
"conditions": [
{
"lastTransitionTime": "2023-12-12T14:53:40Z",
"message": "Discovery failed for some groups, 1 failing: unable to retrieve the complete list of server APIs: custom.metrics.k8s.io/v1beta1: the server is currently unable to handle the request",
"reason": "DiscoveryFailed",
"status": "True",
"type": "NamespaceDeletionDiscoveryFailure"
},
…
]
}
}
如何解决此问题以成功删除命名空间?