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