You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, when a container is started with either --pod or --network=none, it's not possible to use --dns or --add-host.
The docs for --add-host don't say anything about this limitation.
The docs for --dns correctly say that
This option cannot be combined with --network that is set to none
It might sound obvious: when network is "none", why would you want a DNS server or host entry?
Maybe my setup is a bit esoteric, but I use --network=none because I want podman to only setup an empty network namespace. I use an external system that injects veth interfaces into containers to connect them to the rest of the system. That way they can get their own public IP addresses, nftable rules, and use privileged ports while being rootless (which is crazy!).
So in the end I still need /etc/hosts and /etc/resolv.conf but I can't use --dns or --add-host because of the limitations above.
The same is true for pods. For most use-cases it makes sense to share the configuration of DNS and hosts entries between all containers in a pod. But just because containers share the same network namespace doesn't necessarily mean they have to share the same network configuration (which they don't in my case).
Imho it would be more consistent if these options were allowed independently. --dns/--add-host on a container always adds the entries to the respective files on that container. --dns/--add-host on a pod always adds the entries to all containers in the pod.
This also simplifies the documentation because what these arguments do doesn't depend on others (except the obviously conflicting ones; --no-hosts and --dns=none).
It also allows to seperate between shared configuration (on the pod) and individual configuration (on the container).
Changing that wouldn't even be a breaking change, I think.
I'm looking forward to hearing your opinions on this!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Right now, when a container is started with either
--pod
or--network=none
, it's not possible to use--dns
or--add-host
.The docs for
--add-host
don't say anything about this limitation.The docs for
--dns
correctly say thatIt might sound obvious: when network is "none", why would you want a DNS server or host entry?
Maybe my setup is a bit esoteric, but I use
--network=none
because I want podman to only setup an empty network namespace. I use an external system that injects veth interfaces into containers to connect them to the rest of the system. That way they can get their own public IP addresses, nftable rules, and use privileged ports while being rootless (which is crazy!).So in the end I still need
/etc/hosts
and/etc/resolv.conf
but I can't use--dns
or--add-host
because of the limitations above.The same is true for pods. For most use-cases it makes sense to share the configuration of DNS and hosts entries between all containers in a pod. But just because containers share the same network namespace doesn't necessarily mean they have to share the same network configuration (which they don't in my case).
Imho it would be more consistent if these options were allowed independently.
--dns
/--add-host
on a container always adds the entries to the respective files on that container.--dns
/--add-host
on a pod always adds the entries to all containers in the pod.This also simplifies the documentation because what these arguments do doesn't depend on others (except the obviously conflicting ones;
--no-hosts
and--dns=none
).It also allows to seperate between shared configuration (on the pod) and individual configuration (on the container).
Changing that wouldn't even be a breaking change, I think.
I'm looking forward to hearing your opinions on this!
Beta Was this translation helpful? Give feedback.
All reactions