Replies: 3 comments 3 replies
-
I think this is a good question, and I came here with a very similar question. I think I have the answer to my question, but I do not want to believe it is the case. @az-z Take a look at the basic networking tutorial OR the paragraph below. I am curious if you arrive at the same conclusion I am afraid of. The paragraph that scares me is:
To my understanding, because podman uses slirp4netns by default, containers cannot have their ports exposed to the outside network as Docker can. Podman can be configured to provide this feature with netavark, but doing so would require the user to effectively wipe the slate clean and start all over. It is doable, but not the most preferred resolution. |
Beta Was this translation helpful? Give feedback.
-
Thank you Matt for clarification.
In other words - to use bridge and pod is an anti pattern?
…On Thu, Jun 6, 2024, 16:04 Matt Heon ***@***.***> wrote:
Basic explanation:
Containers in a Podman pod always share a network stack, be it root or
rootless, slirp4netns or pasta or netavark. This includes forwarded ports
(if 8080 is forwarded to the pod, every container in the pod can bind to
8080 - though the first to do so will win, as would happen if you tried to
run two HTTP servers on the same port on a host). It also includes
localhost traffic. All containers in a pod have the same localhost -
meaning a container can bind to 8080 on localhost, and every other
container in the pod can reach it via localhost:8080.
The bridge network driver (which uses netavark in the backend) is mostly
for groups of containers not in a pod. Without bridge, all inter-container
communication for rootless containers has to go through pod localhost or
forwarded ports on the host itself. If Container A and Container B aren't
in a pod, Container A cannot access Container B except by connecting to the
host on any port forwarded to B. Bridge networking makes each container
have an IP address again, so now A can connect to any services B is hosting
even if they are not forwarded to the host. Unfortunately the IPs are
inter-container only, so the host can't connect to them (rootless network
has a laundry list of limitations, as you might be able to tell).
—
Reply to this email directly, view it on GitHub
<#22919 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABGHHXO2T33CFRAUAXBB3Y3ZGC6DTAVCNFSM6AAAAABI3N5ABCVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4TMOJTGYYTI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
@az-z It seems we both needed more sleep. Glad your working things out now. |
Beta Was this translation helpful? Give feedback.
-
Hello,
i spent a few very frustrating days getting containers to work together using podman. I'm relatively new to podman.
Task:
I'm working to understand the effects of using "pod", "expose" and "ports" on inter-service communication.
My extremely simplified solution is:
b. port 8888 on the host's firewall is open
c. The test :
The expectation:
since both containers are in the same pod, I expect the mo_sql.php file that resides in the nginx_ora container to be accessible from restapi container.
Note:
Questions
I appreciate your guidance on this matter.
REF:
https://www.redhat.com/sysadmin/compose-podman-pods
Beta Was this translation helpful? Give feedback.
All reactions