3

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   <pending>     8080:31321/TCP   3d21h   app=hello-node
kubernetes          ClusterIP      10.96.0.1        <none>        443/TCP          4d      <none>
tomcat-deployment   LoadBalancer   10.107.218.19    <pending>     8080:32688/TCP   3d16h   app=tomcat
wordpress           NodePort       10.102.29.45     <none>        80:31262/TCP     2d      app=wordpress,tier=frontend
wordpress-mysql     ClusterIP      None             <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?

2 Answers 2

2

Try:

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

It should return something 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 with kubectl get ep -o wide

0

The following command will run fine for services in the same namespace:

wget name.default.svc.cluster.local:8081

OR, using the service IP:

wget 172.20.214.71:8081

Notice that, if the pod is not working fine, you will get the same error, as the service will connect you to a non-working pod. So, check your pod health too.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .