Skip to main content

How to setup route? wget: can't connect to remote host (10.102.29.45): No route to host [Resolved]

After

kubectl run -i -t load-generator --image=busybox /bin/sh

From my shell,I am trying

/ # wget http://wordpress.default.svc.cluster.local
Connecting to wordpress.default.svc.cluster.local (10.102.29.45:80)
wget: can't connect to remote host (10.102.29.45): No route to host

These are my kubernetes service on premise

NAME                TYPE           CLUSTER-IP       EXTERNAL-IP   PORT(S)          AGE     SELECTOR
hello-node          LoadBalancer   10.104.141.138        8080:31321/TCP   3d21h   app=hello-node
kubernetes          ClusterIP      10.96.0.1                443/TCP          4d      
tomcat-deployment   LoadBalancer   10.107.218.19         8080:32688/TCP   3d16h   app=tomcat
wordpress           NodePort       10.102.29.45             80:31262/TCP     2d      app=wordpress,tier=frontend
wordpress-mysql     ClusterIP      None                     3306/TCP         2d      app=wordpress,tier=mysql

Also wget works for google

wget google.com
Connecting to google.com (216.58.214.206:80)
Connecting to www.google.com (216.58.209.164:80)

How to connect to my node?


Question Credit: MikiBelavista
Question Reference
Asked March 15, 2019
Posted Under: Network
37 views
1 Answers

Try

curl -v $(kubectl get ep | grep kubernetes|awk '{print $2}'|cut -d ":" -f1):31262

It should return thmthng like this

Rebuilt URL to: 192.168.99.100:32144/
*   Trying 192.168.99.100...
* Connected to 192.168.99.100 (192.168.99.100) port 32144 (#0)

If it won't work, check your end points kubectl get ep -o wide


credit: A_Suh
Answered March 15, 2019
Your Answer