k8s 一直报 no destination available

no destination available

内核日志不停报 no destination available 这样的 warning 日志,查看 dmesg:

1
2
3
4
5
6
7
8
9
10
[root@k8s-master ~]# dmesg
......
[ 760.443033] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 764.195466] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 764.210921] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 764.457063] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 772.203102] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 772.218299] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
[ 772.464662] IPVS: rr: TCP 10.10.10.31:32567 - no destination available
......

一般是因为有 Service 用了 externalTrafficPolicy:Local,当 Node 上没有该 Service 对应 Pod 时,Node 上的该 Service 对应 NodePort 的 IPVS 规则里,RS 列表为空。当有流量打到这个 Node 的对应 NodePort 上时,由于 RS 列表为空,内核就会报这个 warning 日志。

在云厂商托管的 K8S 服务里,通常是 LB 会去主动探测 NodePort,发到没有这个 Service 对应 Pod 实例的 Node 时,报文被正常丢弃,从而内核报 warning 日志。

这个日志不会对服务造成影响,可以忽略不管。如果是在腾讯云 TKE 环境里,并且用的 TencentOS,可以设置一个内核参数来抑制这个 warning 日志输出:

1
sysctl -w net.ipv4.vs.ignore_no_rs_error=1

参考资料

IPVS no destination available - Kubernetes 实践指南 (imroc.cc)
IPVS 错误日志占用外部流量策略:服务中的本地选项 ·问题 #100925 ·Kubernetes/Kubernetes (github.com)
net: ipvs print limit · Tencent/TencentOS-kernel@fe66d65 (github.com)

打赏
  • 版权声明: 本博客所有文章除特别声明外,著作权归作者所有。转载请注明出处!
  • Copyrights © 2018-2024 Outsrkem
  • 访问人数: | 浏览次数:

      请我喝杯咖啡吧~

      支付宝
      微信