Reputation: 141
I'm trying to create a set of pods intercommunicating with one another over REST, but can't seem to get DNS resolution established between pods. I've looked at Rootless Pod Communication but the provided answer does not appear to work...
Communicate different Pods using Podman has a similar solution, with a caveat that the provided podman run
commands don't even execute/return correctly. It also has a comment with negative upvotes indicating that the solution is to use the dnsname plugin. I looked into the plugin, and it hasn't been updated in ~8 months. Furthermore, this issue seems to indicate that the plugin is unnecessary when operating rootless (due to the infra containers).
The following is the code I've used to create my network/pods. I've also tried using network=test-network
with the run commands, but when I do that the pods end up in a degraded state (presumably because the infra containers end up in a configured state but not a running state).
podman network create test-network
podman pod create --name test-pod1 --network test-network --share net
podman run \
--pod=test-pod1 -d \
--name=test-container1 \
--network-alias=test-pod1-alias \
--add-host test-container1:127.0.0.1 \
--entrypoint='["/bin/sh","-c", "while true; do echo hello; sleep 10;done"]' \
ubi/ubi8:latest test-container1
podman pod create --name test-pod2 --network test-network --share net
podman run \
--pod=test-pod2 -d \
--name=test-container2 \
--network-alias=test-pod2-alias \
--add-host test-container2:127.0.0.1 \
--entrypoint='["/bin/sh","-c", "while true; do echo hello; sleep 10;done"]' \
ubi/ubi8:latest test-container2
Upvotes: 1
Views: 2968
Reputation: 141
I appear to have had some success fixing the problem by installing podman-plugins
from rhel8-appstream
using dnf install podman-plugins
.
It seems that the dnsname plugin is not included in container-tools or in containernetworking-plugins, and is required for the DNS to actually work. Once I installed the podman-plugins I've succeeded in executing ping calls from test-container1 to test-pod2. However, I still don't have any DNS between test-container1 and test-container2 or test-container2-alias.
Upvotes: 2