今天上k8s集群,kubectl命令操作卡顿,执行kubectl get node 命令返回有时很快,有时能卡好几十秒。
然后检查apiserver日志,发现了以下信息
v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.106.18.58:443/apis/metrics.k8s.io/v1beta1: Get https://10.106.18.58:443/apis/metrics.k8s.io/v1beta1: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) loading OpenAPI spec for "v1beta1.metrics.k8s.io" failed with: failed to retrieve openAPI spec, http error: ResponseCode: 503, Body: Error trying to reach service: 'dial tcp 10.106.18.58:443: i/o timeout', Header: map[Content-Type:[text/plain; charset=utf-8] X-Content-Type-Options:[nosniff]] I1118 11:49:26.791429 1 controller.go:127] OpenAPI AggregationController: action for item v1beta1.metrics.k8s.io: Rate Limited Requeue. v1beta1.metrics.k8s.io failed with: Operation cannot be fulfilled on apiservices.apiregistration.k8s.io "v1beta1.metrics.k8s.io": the object has been modified; please apply your changes to the latest version and try again
然后尝试在apiserver中添加如下配置
–enable-aggregator-routing=true
然后再使用kubectl命令操作正常,没有再卡顿了。
—enable- aggregate -routing=true CLI标志添加到kube-apiserver,这样发送到Metrics Server的请求就可以在两个实例之间实现负载平衡。
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:https://sulao.cn/post/896
相关阅读
- k8s使用flannel作为CNI网络插件
- k8s中harbor-database-0日志报Permissions should be u=rwx (0700)的处理方法
- k8s使用helm部署harbor镜像仓库并使用nodeport方式暴露
- k8s集群部署prometheus/node-exporter/dcgm-exporter
- k8s中calico匹配多种网络接口名字的方法
- ubuntu22.04使用containerd部署k8s集群
- k8s集群kube-proxy从iptables模式切换到ipvs模式
- k8s级联删除(删除deployment却删除不了rs和pod)异常问题的处理办法
- k8s中修改containerd存储目录并将数据迁移到新磁盘目录
- k8s网络cni插件calico的安装和网络模式切换
评论列表