-
Notifications
You must be signed in to change notification settings - Fork 489
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
Pod doesn't create #379
Comments
I'm using fedora 34, and things work perfectly. you can use wget to verify that. |
do you use podman-composer version 1.0.3 on fedora34? |
yes, here it's working fine, except that this test docker-compose.yml has a typo in connectivity check reaching web2 from web1:
and vice versa, reaching web1 from web2
|
I can confirm this behaviour on ArchLinux with podman-compose-git from the AUR. └─[$] podman-compose -v I've tested it with the same testing docker-compose.yml you updated. But there is no pod being created, only the containers get deployed. In Previous Versions also a Pod was deployed, which provided the seperate Namespace for the Containers. └─[$] podman-compose -f docker-compose.yml -p busybox_test up -d └─[$] podman pod ls └─[$] podman ps Albeit the └─[$] podman-compose exec busybox_test_web1_1 wget -q -O - http://busybox_test_web2_1:8001/index.txt |
@pixelblut yes, that's normal, why you need it to create a pod!
exec takes service name not container name
should be
that was a workaround because legacy podman (slirp4netns in deed) do not have inter-container communication if you need this behavior you can use
but this has many limitations
|
In my case new version without pod doesn't work and I get the error:
Seems it can't resolve the hostname of other container in one project. |
@dubrsl your setup is exactly the same as mine, but mine works. do you use cni networks or slirp4netns? |
@muayyad-alsadi I found the problem. The package podman-plugins was not installed. |
we need to update README.md |
So how we do tell podman-compose to create the pod? (in the event where we do want all the containers in one pod and communicating via localhost). Surely downgrading to podman-compose<1.0 isnt the only solution? |
the question why do you need to put all containers in a single pod? it was a workaround, because when we started podman-compose we could not use there are many downsides of putting containers in a single pod with a shared network (ex. hostnames, could not run two mysql daemon on same port ...etc.) what is the benefit of maintaining the workaround? it was a workaround, until we get |
Because inside my containers I want to communicate over localhost. If I am able to specify the network inside the yml file then this should be possible. But by putting the containers in a single pod, localhost is the default method of communication? So its just simpler. There may be legitimate reasons to put the containers in a pod? Do you have an alternative suggestion to allow communication between containers over localhost? |
@developedsoftware I've just create a ticket for that. I'll push solution ASAP |
Legend! Thank you! |
Just a small update - resolved the issues with containers not being in a pod by installing the dnsmask plugin. Which is described as being optional. Now I can communicate using the hostnames. However, I do feel that we should have a way of telling podman-compose to stick all the containers into a pod and allow them to communicate over localhost. This is described is many podman tutorials as the quickest way to get an environment up and running - and also does not require the dnsmask plugin - so podman-compose should allow for this (in my opinion - thoughts?) |
It says "Optional Requirement" next to podman dnsname plugin |
aha, he meant by optional that it's not pulled by default with podman package in the repos and you need to add it by hand |
OK, sounds good. Thank you! |
@developedsoftware I've pushed 407, please test
|
Will do, thanks! What does this push do? Do I need to alter my yml file in any way? |
For others who also get confused, the dnsname plugin won't create entries in |
Forgive my ignorance, but that compose file has no reference to a pod? |
can you give me example of a compose that does?
I'll revert that, because I got
when doing
|
now
as you can see, it's always created |
Apologies - I understand it will not be part of the compose spec. I guess my question should be "What do you use to decide if 2 containers should be in the same pod?" Assume its the network namespace? |
the latest devel branch 1.0.4 puts all containers in the compose in one pod (you don't have to specify any thing manually) so that you can use
|
That is my expect way to management the "docker-compose.yaml based" application on my local home server, just like podman-compose <1.0 version. But now when I using podman-compose 1.0.4 (installed from I know the infra or the pod is may unnecessary, but I think it's good to have an option to switch between "create split containers" and "create pod and other staff like podman-compose <1.0". |
the reason there is no infra container, that when I created it with infra but with share nothing, the status of the pod in "podman ps" showed as "degraded". I'm not sure if this is a bug in podman or not. you can comment line 1477 |
@WuSiYu please check this
|
What is the rationale behind not creating an infra container in a pod by default? |
our containers in the pods shares nothing
if we do --share="" with an infra container it will appear STRs
the reason it's |
That leaves the next question: why does it by default share nothing? https://docs.podman.io/en/latest/markdown/podman-pod-create.1.html#share-namespace I have the feeling that at some point there has to be a discussing about whether Don't get me wrong, I'm not experiencing this as a real issue as this is all easily solved by some extra command line arguments. |
because most of compose stack expects the network and uts not to be shared, for example https://github.com/containers/podman-compose/blob/devel/examples/awx3/docker-compose.yml#L27 this stack defines
the way compose is defined does not allow for shared network nor shared uts and maybe does not allow for uts |
I've reported it upstream |
Looks like we now have a solution via the upstream chat? |
Could it be that if your host is running a DNS server (bind in my case), the podman dns plugin won't work? I can't create a network and 2 podman containers and have the containers find each other by container name. It's simply not working, regardless of the podman-plugins package being installed (CentOS 9 stream). I wonder if the DNS server is the cause. |
@martdj sounds strange that your bind service on the host should interfere with dns resolution inside podmans networks. Maybe it's just not correctly setup. I posted in here how I use it, maybe this can help you: #541 (comment) |
Looks clear enough, but somehow it doesn't work for me.
Am I missing something obvious? |
depending on your podman version you need dns plugin
|
netavark and aardvark-dns are installed. The podman-plugins is also installed, but it's version 4.1.1-6.el9. Am I wrong in assuming that seeing the plugins package matches the version of podman, it will install what's necessary for that podman version? If I would uninstall it, it would also uninstall podman-compose as it depends on it The networkBackend of my installation is indeed netavark btw |
we got reports the dns resolution no longer work in podman 4.x with CNI dns plugins. it only works with netavark and aardvark-dns, make sure they are installed and properly configured. you might need to override config to point to netavark you might need to do "down/up", recreate the containers and the network you might need to reset your system maybe with
|
Thanks for the help. I'm not so sure that running your own DNS server isn't an issue for podman and podman network. I exectuted the podman system reset --force, but since then my nextcloud container is giving me trouble. "podman container ls" is hanging if it runs. Also, when I create a net network (podman network create testing), and try to create a pod on that network (podman run -it --network-testing --name=busy1 busybox, the process hangs. That, to me, looks very much like podman tries to start a service on port 53. A port that's taken when you run your own DNS server... |
I guess this says it all: [root@zeus ~]# systemctl stop named [root@zeus ~]# podman run -it --replace --network=testing --name busy2 busybox ping busy1 This is a bug in podman itself guys. I'll create a separate issue |
I got a reply at my bug report. Apparently this is solved in Podman 4.2 and Netavark/Aardvark 1.1.0. For readers on Red Hat 9 / CentOS 9 Stream and a DNS server on their host, I guess it's good to know they can't use podman-compose to connect containers, while they're not yet on those versions (CentOS Stream currently uses 4.1.1) |
@muayyad-alsadi can you (or someone else as well) provide a next podman-compose release. Right now the behaviour between 1.0.3 and the above mentioned devel package (1.0.4) changed significantly in terms of pod creation. Also Using this approach will install what exactly? The latest sources from dev branch, the package which was provided at that day you posted the link? Don't know what exactly is behind it. |
Hallo, I tried the package referred to in last message and I observe that pod is created without specifying the network. Network is still specified per each container individually. Normally in case of pods network is attached to pod and necessary ports are published for the pod as a whole. It looks like specifying same network for each container in pod does not create a common localhost. |
New version doesn't create pod. As a result, communication between containers within the same pod does not work.
To Reproduce
Steps to reproduce the behavior:
podman-compose up -d
Expected behavior
On podman-compose-0.1.7-2.git20201120.el8.noarch
Actual behavior
On new version podman-composer
podman-composer version 1.0.3
podman version 3.4.2
Environment:
Please return the previous behavior.
The text was updated successfully, but these errors were encountered: