-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman: --add-host does not work when specifying --pod #2504
Comments
@baude had some talk of doing this in an automated fashion (run a little DNS server, and automatically add hostnames to it as containers/pods are created). That said, no reason we can't do @rhatdan I don't think we coded containers in a netns to share |
Yes. Containers in a pod should share the same /etc/hosts and /etc/resolv.conf. |
no problem, I can live with that
just give me |
Yes the commands to configure each of the Namespaces should be available on the podman pod create CLI. |
so can I do
|
@muayyad-alsadi I am not opposed to that change, though I have a PR open for a fix for your original issue (doing --add-host on the run call instead of pod create). adding --add-host on pod create will require a larger change. @mheon adding --add-host on pod create will fix the restart problem, but make the hosts in a pod immutable after creation (unless we want both changes). I'm not married either way, but if we do --add-host on pod create, we mine as well add all other namespace configuration commands of a container create/run. WDYT cc: @rhatdan |
@haircommander IMO we go with both changes - |
@mheon yeah I like that too. I'll leave the first PR as is, as they're distinct use cases and it will take some wiring to get pod create to pass a create config to the infra container |
my objective is to get at least one good way to make my podman-compose work, I've pushed 6 ways and none of them currently work. you can test it with (and different way transform)
cntnet does something like
I got the following (with podman 1.1.0 and also with latest commit)
|
I'm using latest podman commit it seems that it did not work yet, I've used add host on c1
this is not correct behaviour, here is the correct behaviour (same podman version)
|
I was trying to guess what to pass to
this half-worked, I don't know why I can't restart it and what should I pass for
|
@muayyad-alsadi the referenced fix isn't upstream yet, you can checkout my branch if you want to try it out, though it may change before it makes it upstream. You can avoid the pod and do this until that fix goes upstream, however: Though I don't think this will work for multiple containers as the example above has. |
@haircommander I've implemented this and it did not work see my I got failed to mount shm tmpfs |
|
@muayyad-alsadi whoops was running in root and didn't have that problem. Let me investigate |
I think that's worth a separate issue. Wonder how we never ran into it before, to be honest. |
should I create one? or #2545 is enough?
my script podman-compose.py has 6 modes (via the script is very simple, it just run podman using subprocess, and it prints the commands it runs.
the only working example is to use host network and manually modify docker-compose.yml to have environments that points to localhost
|
@muayyad-alsadi #2545 addresses the weird output you got when trying to do --share "" in a pod (it should have worked, and the documentation wasn't clear on why it didn't). I opened a new issue #2556 to address the odd error "failed to mount tmpfs" |
/kind bug
Description
when we specify
--pod=mypod
but normally it would work like this
The text was updated successfully, but these errors were encountered: