Search code examples
kuberneteskubectlamazon-eks

EKS: Unable to pull logs from pods


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.


Solution

  • 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.