Troubleshooting connectivity from a pod in kubernetes

Viewed 45

I have created a pod and service, called node-port.

root@hello-client:/# nslookup node-port
Server:     10.100.0.10
Address:    10.100.0.10#53

Name:   node-port.default.svc.cluster.local
Address: 10.100.183.19
  • I can enter inside a pod and see the resolution happening.

However, the TCP connection is not happening from a node.

root@hello-client:/# curl --trace-ascii - http://node-port.default.svc.cluster.local:3050
== Info:   Trying 10.100.183.19:3050...

  • What are the likely factors contributing to failure?
  • What are some suggestions to troubleshoot this?

On a working node/cluster. I expect this to work like this.

/ # curl --trace-ascii - node-port:3050
== Info:   Trying 10.100.13.83:3050...
== Info: Connected to node-port (10.100.13.83) port 3050 (#0)
=> Send header, 78 bytes (0x4e)
0000: GET / HTTP/1.1
0010: Host: node-port:3050
0026: User-Agent: curl/7.83.1
003f: Accept: */*
004c: 
== Info: Mark bundle as not supporting multiuse
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 38 bytes (0x26)
0000: Server: Werkzeug/2.2.2 Python/3.8.13
<= Recv header, 37 bytes (0x25)
0000: Date: Fri, 26 Aug 2022 04:34:48 GMT
<= Recv header, 32 bytes (0x20)
0000: Content-Type: application/json
<= Recv header, 20 bytes (0x14)
0000: Content-Length: 25
<= Recv header, 19 bytes (0x13)
0000: Connection: close
<= Recv header, 2 bytes (0x2)
0000: 
<= Recv data, 25 bytes (0x19)
0000: {.    "hello": "world".}.
{
    "hello": "world"
}
== Info: Closing connection 0
/ # 
0 Answers
Related