I'm encountering an issue where a Kubernetes namespace is stuck in the 'Terminating' state. Running kubectl get ns cattle-monitoring-system -o json|jq produces error messages related to custom.metrics.k8s.io/v1beta1 and shows a DiscoveryFailed condition in the namespace status:
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"
},
…
]
}
}
How can I resolve this issue to successfully delete the namespace?