-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
RFE: Support network aliases #4530
Comments
I imagine the code for dnsname to support this won't be particularly bad,
but it could be a real pain to plumb it through to CNI
…On Mon, Nov 18, 2019, 15:33 Lars Kellogg-Stedman ***@***.***> wrote:
*Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)*
/kind feature
*Description*
In addition to DNS-based container discovery using the container name,
Docker permits an operator to assign aliases to the container. This can be
tremendously useful if you've got a container name that looks something
like "postgres-12-postgis", and you would like to be able to simply refer
to it as "database":
docker run --network=mynetwork --network-alias=database ...
The podman-run man page currently documents the --network-alias option,
but lists it as "Not implemented".
*Additional environment details (AWS, VirtualBox, physical, etc.):*
Implementing this would permit podman-compose to support
docker-compose.yml files that include aliases
<https://docs.docker.com/compose/compose-file/#aliases>.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4530>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AB3AOCCU2QALX4UGH6AAIILQUL3YTANCNFSM4JOZXOIQ>
.
|
I like the idea as well; it would break current dnsname api (i imagine passing a []string of names instead of a string). i double checked the behavior with docker and like us, they require a new network to be made so that name resolution works. I guess --network-alias becomes a throw-away otherwise? |
Well, sort of. They don't support name resolution on the default bridge network because they are preserving legacy behavior (such as the support for I don't see any reason to follow that model. I would say that |
This issue had no activity for 30 days. In the absence of activity or the "do-not-close" label, the issue will be automatically closed within 7 days. |
Any movement on this? |
We discussed this today and how to apply it to Podman. We believe that while this RFE has merit, any implemented would undercut that same merit with performance hits. Using Docker as an example of implementing this shines light on at least one (maybe more) use issues: In Docker, suppose you add a container named Preventing the first case is reasonable easy but is a perf hit to Podman. If a new container with a network-alias of In our discussion, that is where the benefit/cost begins to erode. We will keep this issue open however. |
@baude Still want this issue opened? |
I would like to run jitsi through podman but i'm unable todo so because the docker-compose heavily uses network aliases: currently i've no idea on how to run this with podman. |
@disaster123 I've outlined how we could do it and the up/downsides of it. Do you have a better way to implement this or better yet, care to contribute? |
I also make use of network aliases when creating containers with a network. And I also have no idea how to workaround this with podman. I thought I could do the following:
However this leads to another issue. The (not running) container:/etc/hosts files do NOT contain a line for the container host name. For (not running) containers, created with docker create, the container:/etc/hosts contains this line. In order to properly edit the /etc/hosts files we need the actual ip addresses that podman has assigned them. For podman containers the container:/etc/hosts file only contains the hostname when actually running. eg The missing --network-aliases is a currently a showstopper for me. |
The copy workflow isn't really supported with Podman (it looks like Docker does not handle that file as a bind mount, while we do - so the file in the container when it's not running will be mounted over even if changed). I think that launching the container once and editing |
Ahhh, nevermind - it looks like we recreate |
Being a podman newby I thought I was most likely missing out on something obvious on a better way to handle a network alias. But then I discovered this RFE and after reading the comments I am apparently not missing out. |
We could potentially do this as part of the more-general aliases code I want to add, but that could be a way off, given our current focus on the new HTTP API |
Just wanted to add my two cents in saying that I too think this feature is really important and worthwhile. For me it is the one major As for @baude 's concerns, while I do get the naming clashing problem I'm really not convinced this is anything but theoretical and/or user error. If the user configures name clashes that's really their own fault and resolving clashing names to either entity in whatever preference sounds like perfectly okay behavior in that situation and nothing This is especially true since I feel like in 99% of cases the aliases and container names will be created by a tool like |
+1 |
I agree with @niklas88 in that any name clash issues are the users issue/fault. |
I think PRs would help to move this along. Hint, Hint. |
@rhatdan Only so much time in the day 😄 |
Understood. |
I understand this might still open issue, but is there anyway to go around this, any currently existing feature that we can use to go around it? |
@mhmr I think the only (really hacky) way of doing this right now is to exec into the rootless-cni-infa container and update the edit: you also need to force the dnsmasq daemon to restart by quickly starting another container after updating the addnhosts file. Its really hacky, but it works. |
This is actively being worked on and will probably make it into Podman 2.2 |
Fantastic! |
merged today upstream. |
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature
Description
In addition to DNS-based container discovery using the container name, Docker permits an operator to assign aliases to the container. This can be tremendously useful if you've got a container name that looks something like "postgres-12-postgis", and you would like to be able to simply refer to it as "database":
The
podman-run
man page currently documents the--network-alias
option, but lists it as "Not implemented".Additional environment details (AWS, VirtualBox, physical, etc.):
Implementing this would permit
podman-compose
to supportdocker-compose.yml
files that include aliases.The text was updated successfully, but these errors were encountered: