Skip to content

port-forwarding doesn't work #9704

Closed Answered by brandond
ostapkostyk asked this question in Q&A
Discussion options

You must be logged in to vote

Forwarding from 127.0.0.1:3003 -> 80

Then, when I try to reach it from outside, if fails:

$ curl http://<HOST_IP>:3003/
curl: (7) Failed to connect to <HOST_IP> port 3003 after 145 ms: Connection refused

By default, forwarded ports are only available via the loopback address. It specifically tells you that in the kubectl port-forward output.

Run kubectl port-forward --help and note the bit where it says:

  # Listen on port 8888 on all addresses, forwarding to 5000 in the pod
 kubectl port-forward --address 0.0.0.0 pod/mypod 8888:5000

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@saviour123
Comment options

Answer selected by brandond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants