-
Notifications
You must be signed in to change notification settings - Fork 48
hostname points to the name of the infra container instead to hostname of the pod itself #11
Comments
tl;dr. I would need a 'poor man's' service discovery. Find published ports of pods on the same network by using the name of the pods. And not by the name of the infra container of a pod. |
@abalage name resolution does is not supported yet for pods ... BUT I am currently working on it |
Great to hear. I am happy to test any release you may have. |
I would be interested in this feature as well, since I would like to use "podman play kube" as a way to import podman configurations. When you do that, everything gets imported as a pod, so my workaround has been to manually add the container name entries to addnhosts file. Would this be the correct place to track the progress? |
@baude any news re 'currently working on it'? |
@mi-hol sorry! yes, name resolution for pods works like containers now. Remember all containers in a podman pod share the same network namespace by default. So you can set the hostname with podman pod create --hostname. |
@baude , would your answer mean that this issue should be closed? |
I think so but always nice that the reported concurs... closing. Please re-open or open a new issue if you disagree. |
Hello @baude, so a quick question about using this feature. I am running the following:
|
Hi,
I am having an issue with name resolution not working with pod names.
I would like to achieve pod-to-pod communication via hostnames / DNS of pods.
I create a pod for each different systems I may use. Each pods contain different number of containers. The plugin dnsname is configured for the default network.
The very basic setup I'd like to achieve can be seen on the picture below.
As all the pods are attached to the same network (cni-podman0) IP connectivity is not a problem.
Checking the hosts file within containers of the same pod I see that they aware of the hostname of the pod as well its IP address.
However the DNS service running in the same network is only resolving the IP addresses of infra containers. The problem with that is their name is auto generated from the ID of the pod. I cannot rely on them. I would rather like to see the --name or --hostname of the pods bounded to the IP of infra contrainer by dnsname.
Checking the source code I could find this part.
dnsname/plugins/meta/dnsname/main.go
Lines 223 to 226 in f5af33d
But I do not know whether 'podname' should point to the name of the pod (sounds reasonable) of to the name of the container?
Here are some details you may find useful.
The text was updated successfully, but these errors were encountered: