问题描述
某 Kubernetes 集群,负载高 Node 状态总是时而出现 NotReady 状态,集群不稳定,查看节点日志,存在如下错误:
Error updating node status, will retry: error getting node "node01": Get https://x.x.x.x:6443/api/v1/nodes/node01?timeout=10s: net/http: request canceled (Client.Timeout exceeded while awaiting headers)
问题分析
出现该问题的主要原因是:
高负载 node 与 apiserver 之间建立的连接数太多了,导致这些连接的 tls 握手时间越来越长,最终超过客户端超时时间 10 秒,客户端主动断开了连接
解决办法
为 apiserver 配置
--http2-max-streams-per-connection参数,配置一个较大的值(例如 2000),以让每个连接支持更多的 stream,从而减少新连接的创建,减少连接数
Ref: https://www.lagou.com/lgeduarticle/53137.html
本文分析了Kubernetes集群中Node状态频繁变为NotReady的问题,主要原因是高负载Node与apiserver间连接过多,导致TLS握手超时。通过调整apiserver的--http2-max-streams-per-connection参数,可有效减少新连接创建,稳定集群。
2570

被折叠的 条评论
为什么被折叠?



