EKS:无法从 Pod 中提取日志 [英] EKS: Unable to pull logs from pods

查看:29
本文介绍了EKS:无法从 Pod 中提取日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

kubectl logs 命令间歇性失败并显示getsockopt: no route to host"错误.

# kubectl logs -f mypod-5c46d5c75d-2Cbtj

<块引用>

来自服务器的错误:获取https://XXXX:10250/containerLogs/default/mypod-5c46d5c75d-2Cbtj/metaservichart?follow=true:拨号 tcp X.X.X.X:10250: getsockopt: 没有到主机的路由

如果我运行相同的命令 5-6 次,它会起作用.我不确定为什么会这样.任何帮助将不胜感激.

解决方案

仅供参考,我刚刚尝试在 EKS 上使用另一个 VPC 172.18.X.X,所有 kubectl 命令都可以正常工作.

我还注意到,当我使用 172.17.X.X VPC 时,kops 使用 172.18.X.X 作为 docker 的内部 cidr.所以我推测 kops 更改了默认的 docker 的 cidr 以不与集群 IP 冲突.我希望我们可以在创建 EKS 工作节点时配置 docker 的 cidr,也许通过 CloudFormation yaml 模板或其他东西.

kubectl logs command intermittently fails with "getsockopt: no route to host" error.

# kubectl logs -f mypod-5c46d5c75d-2Cbtj

Error from server: Get https://X.X.X.X:10250/containerLogs/default/mypod-5c46d5c75d-2Cbtj/metaservichart?follow=true: dial tcp X.X.X.X:10250: getsockopt: no route to host

If I run the same command 5-6 times it works. I am not sure why this is happening. Any help will be really appreciated.

解决方案

Just fyi, I just tried using another VPC 172.18.X.X on EKS, and all kubectl commands works fine.

Also I noticed that kops uses 172.18.X.X for docker's internal cidr when I was using 172.17.X.X VPC. So I speculate that kops changes default docker's cidr not to collide with cluster IP. I hope we could configure docker's cidr when EKS worker nodes are created, maybe by CloudFormation yaml template or something.

这篇关于EKS:无法从 Pod 中提取日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆