containers / dnsname

name resolution for containers
Apache License 2.0
177 stars 47 forks source link

Only one container from a pod ends up in addnhosts #92

Closed farnoy closed 2 years ago

farnoy commented 2 years ago

I have a pod like with 2 containers + infra

$ sudo podman pod inspect hass --format "{{range .Containers}}{{.Name}}\n{{end}}"
homeassistant
zwave2jsmqtt
453bd1d52ce6-infra

But only the first one gets registered in /etc/hosts of other containers in the network, as shown by:

$ sudo cat /run/containers/cni/dnsname/hass/addnhosts
10.89.0.56      hass    ee77bab166d6

Why isn't my other container accessible by name?

farnoy commented 2 years ago

Ugh, the dns name is the pod's name, not any container's. I only realized after submitting it 🤦