<p>Is there a corresponding command with <code>kubectl</code> to:</p>

<pre><code>ssh -L8888:rds.aws.com:5432 example.com
</code></pre>

<p><code>kubectl</code> has <code>port-forward</code> you can also specify <code>--address</code> but that strictly requires an IP address.</p>

<p>The <a href="https://stackoverflow.com/a/61271752">older answer</a> is valid.
Still, a workaround would be to use something like
<a href="https://hub.docker.com/r/marcnuri/port-forward" rel="noreferrer">https://hub.docker.com/r/marcnuri/port-forward</a></p>
<p><code>kubectl run --env REMOTE_HOST=your.service.com --env REMOTE_PORT=8080 --env LOCAL_PORT=8080 --port 8080 --image marcnuri/port-forward test-port-forward</code></p>
<p>Run it on the cluster and then port forward to it.</p>
<p><code>kubectl port-forward test-port-forward 8080:8080</code></p>
