title: Podman(1): How to route requests between the HOST and PODs attached to a podman network (rootless)
body: <p>Let me use a real example to aid this question.</p>
  <p>Using <code>rootless podman(1)</code>, I start a tiny <code>Spark</code> cluster within it's own <code>Pod</code> using the following script, which works well:</p>
  <pre><code>#! /usr/bin/bash
  
  podman network create --subnet 192.168.10.0/24 --gateway 192.168.10.1 mynet
  
  podman pod create \
      --name=spark \
      --network=mynet \
      --share net \
      --publish 7077:7077 \
      --publish 8080:8080
  
  podman run \
      --detach \
      --pod=spark \
      --name=master01 \
      --hostname spark \
      --restart always \
      --env SPARK_MODE=master \
      --env SPARK_RPC_AUTHENTICATION_ENABLED=no \
      --env SPARK_RPC_ENCRYPTION_ENABLED=no \
      --env SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no \
      --env SPARK_SSL_ENABLED=no \
      --add-host spark:127.0.0.1 \
      --add-host worker01:127.0.0.1 \
      docker.io/bitnami/spark:latest
  
  podman run \
      --detach \
      --pod=spark \
      --name=worker01 \
      --hostname worker01 \
      --restart always \
      --env SPARK_MODE=worker \
      --env SPARK_MASTER_URL=spark://spark:7077 \
      --env SPARK_WORKER_MEMORY=4G \
      --env SPARK_WORKER_CORES=8 \
      --env SPARK_RPC_AUTHENTICATION_ENABLED=no \
      --env SPARK_RPC_ENCRYPTION_ENABLED=no \
      --env SPARK_LOCAL_STORAGE_ENCRYPTION_ENABLED=no \
      --env SPARK_SSL_ENABLED=no \
      --add-host spark:127.0.0.1 \
      --add-host worker01:127.0.0.1 \
      docker.io/bitnami/spark:latest
  </code></pre>
  <p>Following is an image of the <code>SparkUI</code>.</p>
  <p>(<code>Note</code>: This question uses <code>Spark</code> as an aid, but is not itself about <code>Spark</code>).</p>
  <p><a href="https://i.stack.imgur.com/3uBcf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3uBcf.png" alt="enter image description here" /></a></p>
  <p>See lower-left corner of the browser image. Hovering the mouse over the only available <code>Spark worker</code> link (beneath <code>Worker id</code>), notice that the URL resolves to <code>192.168.10.2</code>, which is a valid <code>Pod IP-Address</code> falling within the <code>podman network</code> created above.</p>
  <p>However, clicking that URL will, of course, hang because that <code>Pod IP-Address</code> is not reachable from the <code>HOST</code>. With <code>docker(1)</code> (not <code>podman(1)</code>) there's a gateway mechanism to routes requests between <code>guest containers</code> and the <code>Host</code>.</p>
  <p>How is this accomplished with <code>podman(1)</code>?</p>
  <p>A few other points to help:</p>
  <ul>
  <li>This is an example <code>Spark Pod</code>. There are additional <code>Pod</code>s that attach that same <code>pod network</code>: <code>mynet</code></li>
  <li>I don't want to publish extra ports, because that will break anyway once you go deeper into the <code>UI</code>. More importantly, doing that defeats the purpose of <code>Pod</code>s, which isolate conflicting ports from one another. Rather, I need to understand how to &quot;gateway&quot; these requests.</li>
  <li>Finally, I'm humbled because I thought I knew <code>podman(1)</code> quite well. <code>LoL</code></li>
  </ul>
  <p>Thank you in advance.</p>