3

I created a service exposing port 8000/TCP and trying to get that port forwarded to my Mac.

$ kubectl describe svc ddb
Name:              ddb
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          app=local-ddb
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.43.215.24
IPs:               10.43.215.24
Port:              <unset>  8000/TCP
TargetPort:        ddb-http-port/TCP
Endpoints:         10.42.0.91:8000
Session Affinity:  None
Events:            <none>

Port seems indeed open on my Mac (NOTE I found the local port number by looking at the Rancher Desktop GUI)

lsof | grep 56107
Rancher   50831 victorbarbu   84u     IPv4 0x8f04a06a4fb87541         0t0                 TCP localhost:56107 (LISTEN)

Doing curl http://localhost:56107 just hangs, however running:

$ kubectl run bb -i --tty --image alpine
# curl http://ddb:8000
{"__type":"com.[TRUNCATED]

Works as expected. Why could that be? How do I fix it?

Victor
  • 13,914
  • 19
  • 78
  • 147

0 Answers0