Welcome to the Linux Foundation Forum!

unable to connect pods

I am unable to connect to pods using the kubectl exec. I installed the cluster with 1master node and 2 worker node with 1.15 version.

root@master:~# kubectl get pods -n kube-system -o wide
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
calico-node-ccj27 1/2 Running 0 2m59s 172.25.4.123 master
calico-node-lm2c9 1/2 Running 0 29h 172.25.4.96 worker2
calico-node-n527t 1/2 Running 0 7s 172.25.4.8 worker1
coredns-5c98db65d4-r2c76 1/1 Running 1 29h 192.168.0.5 master
coredns-5c98db65d4-t5shf 1/1 Running 1 29h 192.168.0.4 master
etcd-master 1/1 Running 1 29h 172.25.4.123 master
kube-apiserver-master 1/1 Running 2 29h 172.25.4.123 master
kube-controller-manager-master 1/1 Running 1 29h 172.25.4.123 master
kube-proxy-66qns 1/1 Running 0 29h 172.25.4.8 worker1
kube-proxy-h487s 1/1 Running 2 29h 172.25.4.123 master
kube-proxy-rg5gz 1/1 Running 0 29h 172.25.4.96 worker2
kube-scheduler-master 1/1 Running 1 29h 172.25.4.123 master
root@master:~#
root@master:~#
root@master:~#
root@master:~# kubectl exec nginx-7bffc778db-nwwrv -- printenv | grep SERVICE
Error from server: error dialing backend: dial tcp 172.25.4.8:10250: i/o timeout

Comments

  • Hi,
    I created the cluster on AWS ec2 instances and forget to open the ports at security groups.
    Just now opened the ports and able to connect with Pods.

  • Kubernetes is quite sensitive to infrastructure networking issues. Good to know you were able to figure out the cause of the error.

    It is also recommended to run kubectl as non-root.


    Regards,

    -Chris

Categories

Upcoming Training