Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused

11/6/2017

I have a kubernetes cluster with three nodes: 10.9.84.149,10.9.105.90 and 10.9.84.149. When my application tries to execute the command inside some pod:

kuebctl exec -it <podName> 

it sometimes gets an error:

Error from server: error dialing backend: dial tcp 10.9.84.149:10250: getsockopt: connection refused

As far as I could see everything was fine with the cluster: all kube-system services and pods were running well. Besides, it didn't appear regularly.

Can anybody help me on this issue?

-- killer_nudt
docker
kubernetes

2 Answers

5/11/2019

I got the same error as this below

Error from server: Get https://192.168.100.102:10250/containerLogs/default/kubia-n8nv9/kubia: dial tcp 192.168.100.102:10250: connect: no route to host

DISABLING THE FIREWALL WAS MY FIX ON ALL NODES

I figured out my worker nodes firewall was not disabled. I did instruction below to fix my problem

systemctl disable firewalld && systemctl stop firewalld
-Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1...
-Removed symlink /etc/systemd/system/basic.target.wants/firewalld.service.```
-- Ano
Source: StackOverflow

11/6/2017

Looks like your kubelet process not running, or keep restarting.

 ss -tnpl |grep 10250
LISTEN     0      128         :::10250                   :::*                   users:(("kubelet",pid=1102,fd=21))
  1. check kubelet process is running.
  2. if its running see when its started.
  3. look at /var/log/message file for any issue with node.
  4. Make sure you don't have the firewall blocking the traffic
-- sfgroups
Source: StackOverflow