Let me use a real example to aid this question.
Using rootless podman(1)
, I start a tiny Spark
cluster within it's own Pod
using the following script, which works well:
#! /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
Following is an image of the SparkUI
.
(Note
: This question uses Spark
as an aid, but is not itself about Spark
).
See lower-left corner of the browser image. Hovering the mouse over the only available Spark worker
link (beneath Worker id
), notice that the URL resolves to 192.168.10.2
, which is a valid Pod IP-Address
falling within the podman network
created above.
However, clicking that URL will, of course, hang because that Pod IP-Address
is not reachable from the HOST
. With docker(1)
(not podman(1)
) there's a gateway mechanism to routes requests between guest containers
and the Host
.
How is this accomplished with podman(1)
?
A few other points to help:
- This is an example
Spark Pod
. There are additionalPod
s that attach that samepod network
:mynet
- I don't want to publish extra ports, because that will break anyway once you go deeper into the
UI
. More importantly, doing that defeats the purpose ofPod
s, which isolate conflicting ports from one another. Rather, I need to understand how to "gateway" these requests. - Finally, I'm humbled because I thought I knew
podman(1)
quite well.LoL
Thank you in advance.