我是靠谱客的博主 繁荣夕阳,这篇文章主要介绍the server is currently unable to handle the request (get nodes.metrics.k8s.io),现在分享给大家,希望可以做个参考。
在部署metrics server后,pod启动成功,但是使用kubectl top node命令时,显示报错:
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
多方查看后,发现在master节点上ping不同metrics server的podIP。两天的排错,才发现是使用calico网络bgp模式后,不同网段之间通信,pod不通
这里重新生成calico的ippool,使用calico网络的crosssubnet网络实现
# 1、备份当前的ippool
calicoctl get ippool -o yaml > pool_bak.yaml
# 2、修改pool_bak.yaml
#----在
natOutgoing: true后面添加一行,关闭该ippool
disabled: true
# 3、应用使生效
calicoctl apply -f pool_bak.yaml
# 4、查看ippool
calicoctl get ippool -o wide
# ***如下显示
# --NAME
CIDR
NAT
IPIPMODE
DISABLED
# default-ipv4-ippool
10.66.0.0/16
true
Never
true
# ****
# 5、删除旧的ippool
calicoctl delete pool default-ipv4-ippool
# 6、新建新的ippool
calicoctl create -f -<<EOF
apiVersion: projectcalico.org/v3
kind: IPPool
metadata:
name: new-pool
spec:
cidr: 10.67.0.0/16
ipipMode: CrossSubnet
natOutgoing: true
EOF
# 7、查看新的ippool
# NAME
CIDR
NAT
IPIPMODE
DISABLED
# new-pool
10.66.0.0/16
true
CrossSubnet
false
然后将metrics server等pods重新生成,就可以解决问题啦
BINGO
BINGO
BINGO
BINGO
最后
以上就是繁荣夕阳最近收集整理的关于the server is currently unable to handle the request (get nodes.metrics.k8s.io)的全部内容,更多相关the内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复