HI Peter,
I tried as root
if I inspect all pods no ip address provided.. trying with several
pods and containers.
I tried with this tutotial from here:
https://mkdev.me/en/posts/dockerless-part-3-moving-development-environmen...
[root@localhost ~]# podman pod ls
POD ID NAME STATUS CREATED # OF CONTAINERS INFRA ID
a15e247a9558 postgresql Running 4 minutes ago 3
6b7481f28b7e
[root@localhost ~]# podman pod top a15e247a9558
USER PID PPID %CPU ELAPSED TTY TIME COMMAND
0 1 0 0.000 5m4.173282345s ? 0s /pause
postgres 1 0 0.000 5m3.174439796s ? 0s postgres
postgres 50 1 0.000 5m1.174538347s ? 0s
postgres: checkpointer
postgres 51 1 0.000 5m1.174584028s ? 0s
postgres: background writer
postgres 52 1 0.000 5m1.174633436s ? 0s
postgres: walwriter
postgres 53 1 0.000 5m1.174682982s ? 0s
postgres: autovacuum launcher
postgres 54 1 0.000 5m1.174729699s ? 0s
postgres: stats collector
postgres 55 1 0.000 5m1.174779004s ? 0s
postgres: logical replication launcher
[root@localhost ~]# podman ps -a
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES
fdcf1d593062 docker.io/wrouesnel/postgres_exporter:latest
/postgres_exporte... 6 minutes ago Exited (1) 6 minutes ago
0.0.0.0:5432->5432/tcp zealouskare
a60ba9b03c35 docker.io/library/postgres:latest
docker-entrypoint... 6 minutes ago Up 6 minutes ago
0.0.0.0:5432->5432/tcp keennightingale
6b7481f28b7e k8s.gcr.io/pause:3.1
6 minutes ago Up 6 minutes ago
0.0.0.0:5432->5432/tcp a15e247a9558-infra
inspecting infra container gives me always the same null result :
[root@localhost ~]# podman inspect 6b7481f28b7e
[
null
]
IP for postgress pod gives empty value:
[root@localhost ~]# podman inspect a60ba9b03c35 | grep IP
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"SecondaryIPAddresses": null,
"SecondaryIPv6Addresses": null,
"GlobalIPv6Address": "",
"GlobalIPv6PrefixLen": 0,
"IPAddress": "",
"IPPrefixLen": 0,
"IPv6Gateway": "",
but iptables shows that ip is assigned and I can connect to the pod by this ip:
root@localhost ~]# iptables -L -n
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
CNI-FORWARD all -- 0.0.0.0/0 0.0.0.0/0 /* CNI
firewall plugin rules */
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain CNI-ADMIN (1 references)
target prot opt source destination
Chain CNI-FORWARD (1 references)
target prot opt source destination
CNI-ADMIN all -- 0.0.0.0/0 0.0.0.0/0 /* CNI
firewall plugin rules */
ACCEPT all -- 0.0.0.0/0 10.88.0.14 ctstate
RELATED,ESTABLISHED
ACCEPT all -- 10.88.0.14 0.0.0.0/0
[root@localhost ~]# podman exec a60ba9b03c35 cat /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.88.0.14 mrsdalloway
So IP is assigned just not visible for inspect command.
Am Mo., 5. Aug. 2019 um 21:05 Uhr schrieb Peter Hunt <pehunt(a)redhat.com>:
>
> That's very odd, I have started the same container in a pod, and checked with
both `--format {{.NetworkSettings}}` as well as `| grep IP` Are you sure you are using the
correct user? In your example, you spawned the pod as root, but you sent the output of a
non-root user.
>
> On Mon, Aug 5, 2019 at 2:58 PM Matt Heon <mheon(a)redhat.com> wrote:
>>
>> On 2019-08-05 14:15, Peter Hunt wrote:
>> >This is because the network configuration is stored in the infra container
>> >(the creator and holder of the network namespace). I definitely think this
>> >should be easier to access, but you can get the IP address by doing the
>> >following:
>> >`podman ps -a | grep infra` will get you the container ID of the infra
>> >container
>> >`podman inspect --format "{{.NetworkSettings}}" $INFRA_ID` will get
you the
>> >IP address.
>> >
>>
>> We should also look into adding this into `podman pod inspect`, and
>> potentially making `podman inspect` on the container return config
>> information for the container we share a network namespace with.
>>
>> >On Mon, Aug 5, 2019 at 2:08 PM <nikolaj(a)majorov.biz> wrote:
>> >
>> >> Hi I running container in pod and it is not getting an ip address.
>> >>
>> >> sudo podman pod create --name drupal -p 3306 -p 8080:80 -p 8443:443
>> >>
>> >>
>> >> sudo podman run --pod drupal \
>> >> -e MARIADB_USER=bn_drupal \
>> >> -e MARIADB_PASSWORD=drupal \
>> >> -e MARIADB_ROOT_PASSWORD=redhat \
>> >> -e MARIADB_DATABASE=bitnami_drupal \
>> >> --volume mariadb_data:/bitnami \
>> >> --rm -it docker.io/bitnami/mariadb:10.3
>> >>
>> >> so then I inspect network setting of container in the pod it is not
>> >> getting an ip address:
>> >> podman inspect --format "{{.NetworkSettings}}" 05905843e7d6
>> >> { false 0 [] [] [] 0 0 }
>> >>
>> >> if I run same container without a pod I get an ip address:
>> >>
>> >> sudo podman run
>> >> -e MARIADB_USER=bn_drupal \
>> >> -e MARIADB_PASSWORD=drupal \
>> >> -e MARIADB_ROOT_PASSWORD=redhat \
>> >> -e MARIADB_DATABASE=bitnami_drupal \
>> >> --volume mariadb_data:/bitnami \
>> >> --rm -it docker.io/bitnami/mariadb:10.3
>> >>
>> >> podman inspect --format "{{.NetworkSettings}}" 3f760c0aad51
>> >> { false 0 [] /var/run/netns/cni-b8f71228-9609-8585-5952-4112548c737b
[]
>> >> [] 10.88.0.1 0 10.88.0.7 16 92:62:fd:37:1b:bb}
>> >>
>> >> why it happens ?
>> >> is there something I forget or missing ?
>> >>
>> >> [vagrant@localhost ~]$ podman version
>> >> Version: 1.4.4
>> >> RemoteAPI Version: 1
>> >> Go Version: go1.12.7
>> >> OS/Arch: linux/amd64
>> >> _______________________________________________
>> >> Podman mailing list -- podman(a)lists.podman.io
>> >> To unsubscribe send an email to podman-leave(a)lists.podman.io
>> >>
>>
>> >_______________________________________________
>> >Podman mailing list -- podman(a)lists.podman.io
>> >To unsubscribe send an email to podman-leave(a)lists.podman.io