Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

understanding why podman-compose does things differently than podman itself #602

Open
spi43984 opened this issue Dec 3, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@spi43984
Copy link

spi43984 commented Dec 3, 2022

This is not a bug report but an attempt to understand podman-compose better.

From some experiments I understand that podman itself

  • supports pods with own namespaces, i. e. containers inside one pod can talk via the loopback interface
  • creates an infra container inside a pod to keep the pod and its resources up and running

From what I see, podman-compose does that differently:

  • pods don't contain an infra container
  • pods get their own network assigned and every container gets an own IP address

I can get podman-compse to create an infra container as well by setting --pod-args='--infra=true --share=""' (can I set this in the compose.yml as well? Otherwise I need to change the systemd unit file as well). I can bind different container (services) to the same IP address by setting network_mode: "service:<servicename>" in the compose.yml file. I understand that in case I need to bind different services to the same port numbers I need different IP addresses and can't work with just one loopback address (but I still could use different loopback addresses in that case).

I'd like to understand what podman-compose all does differently than podman and why it does so - what are the benefits and maybe issues?

@spi43984 spi43984 added the bug Something isn't working label Dec 3, 2022
@muayyad-alsadi
Copy link
Collaborator

because this is what users who have existing yaml expect
for example https://github.com/containers/podman-compose/blob/devel/examples/awx3/docker-compose.yml

version: '3'
services:
# ...
  awx_web:
    image: "ansible/awx_web:3.0.1"
    hostname: awxweb
# ...

here this contain need to set a different hostname than the rest of the pod.

image two mysql servers one master and one slave on same pod, they need to open same port
which can't be done if they both are localhost

long long ago (when rootless containers did not have inter-container networking) we used to put all containers in a pod and make them talk via localhost

now rootless inter-container communication is feasible, so we moved to be more aligned with the SPEC
so we give our users what they expect without sacrificing the rootless daemon-less principles of podman

@muayyad-alsadi
Copy link
Collaborator

muayyad-alsadi commented Apr 13, 2023

--pod-args='--infra=true --share=""' (can I set this in the compose.yml as well?

because starting the pod created with infra=true will report degraded unhealthy pod (because no one starts the infra, it will have let's say 4 containers only 3 of them running)

maybe this was a bug that is solved in podman v4 let me double check

UPDATE: here is the context

containers/podman#15048

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants