<p>How can I forward traffic from a remote Kubernetes pod to a server running on my local machine? The intention is to test a remote server making calls to a service running on my local machine. I've used <code>kubectl port-forward</code> to forward traffic from my local service to remote service, but I need to do this the other way around.</p>
<p><a href="https://stackoverflow.com/a/63885761/2233706">This solution</a> is for minikube, which is used to run Kubernetes locally, so this probably doesn't apply to me.</p>

<p>There's probably a &quot;more K8s&quot; way, but here's an idea in case you don't find anything better - use ssh.</p>
<p>Specifically, set up and expose SSH on the pod so it's accessible from your local machine. Then just use ssh on your machine to create a <a href="https://robotmoon.com/ssh-tunnels/#remote-port-forwarding" rel="noreferrer">remote ssh tunnel</a>.</p>
<p>For instance <code>ssh -R 8080:localhost:80 &lt;exposed-pod-ssh&gt;</code> will forward the pod's localhost:8080 to your local machine port 80.</p>
