在部署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