k8s 集群 master 节点上 kube-controller-manager pod 无法启动
NAME READY STATUS RESTARTS
kube-controller-manager-k8s-master0 0/1 CrashLoopBackOff 152
查看 pod 日志发现下面的错误
E0108 02:02:02.147857 1 controllermanager.go:426] unable to get all supported resources from server: unable to retrieve the complete list of server APIs: metrics.k8s.io/v1beta1: the server is currently unable to handle the request
......
E0108 02:02:12.199396 1 controllermanager.go:522] Error starting "nodeipam"
F0108 02:02:12.199418 1 controllermanager.go:235] error starting controllers: failed to mark cidr[10.244.0.0/24] at idx [0] as occupied for node: k8s-master0: cidr 10.244.0.0/24 is out the range of cluster cidr 192.168.0.0/16
请问如何解决?
对于 "unable to get all supported resources from server" 错误,参考 github issue 中的评论 ,kubectl get apiservice 找出 AVAILABLE 为 false 的 apiservice ,将其删除后解决了。
kubectl delete apiservice v1beta1.metrics.k8s.io