I am attempting to reverse port forward information from a Kubernetes pod to my locoalhost:8000 but I am having issues.

The goal is to get the same response as curl on localhost:8000

One thing I have tried has been using ktunnel with the command ktunnel expose <service_name> 30085:8000 to try to forward this info. Doing this I get the output

INFO[0000] Exposed service's cluster ip is:
.INFO[0000] waiting for deployment to be ready
INFO[0001] port forwarding to
INFO[0001] Waiting for port forward to finish
INFO[0001] Forwarding from -> 28688
INFO[2022-08-03 20:23:48.605] starting tcp tunnel from source 30085 to target 8000

Which seems normal and I am able to get a response when using curl on local host 8000 but not the correct response.

I have also attempted to run a tcp server with the command nc 8000 | kubectl exec -i <pod_name> tcpserver 30085 cat But am having poor results as well. Am I using these services incorrectly? Or is there a better way to do this all together?

2 Answers 2


If you have access to kubectl, try

kubectl port-forward service/<servicename> 8000:30085.


Expose SSH on the pod and use SSH to do the reverse port forward


Use a service on the cluster pointing at your machine but that assumes the networking is connected some how

Those 2 anwsers were taken from this duplicate question. https://stackoverflow.com/questions/66666273/forward-traffic-from-kubernetes-pod-to-local-server

I think a third better approach might be to use somekinda mesh VPN like https://tailscale.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.