Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compose does not use pasta network #967

Open
az-z opened this issue Jun 19, 2024 · 7 comments
Open

compose does not use pasta network #967

az-z opened this issue Jun 19, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@az-z
Copy link

az-z commented Jun 19, 2024

Describe the bug
i can't figure out how to make compose to use the pasta network mode.

please try to reproduce the bug in latest devel branch

To Reproduce
Steps to reproduce the behavior:
podman-compose version 1.1.0
podman version 4.9.4

Fedora release 39 (Thirty Nine)

I reset the system and specified the default network mode ( is it mode ? or is it a driver? ) to pasta:

[sailtech@dell5000 ~]$  grep cmd ~/.config/containers/containers.conf 
#default_rootless_network_cmd = "slirp4netns"
default_rootless_network_cmd = "pasta"
#network_cmd_path = ""
#network_cmd_options = []

[sailtech@dell5000 ~]$  podman info | grep networkBackend
  networkBackend: netavark
  networkBackendInfo:

[sailtech@dell5000 ~]$ podman run  -d --name=myubi registry.access.redhat.com/ubi8/ubi
[sailtech@dell5000 ~]$ podman inspect --format {{.HostConfig.NetworkMode}} myubi
pasta

[sailtech@dell5000 ~]$ podman-compose --in-pod=yes -f ./podman-compose.yml up
....
[sailtech@dell5000 ~]$ podman inspect --format {{.HostConfig.NetworkMode}} sailtech_restapi_1
bridge

[sailtech@dell5000 ~]$ podman network  ls
NETWORK ID    NAME              DRIVER
2f259bab93aa  podman            bridge
8f1d4e09447a  sailtech_default  bridge

[sailtech@dell5000 ~]$ podman network inspect sailtech_default
[
     {
          "name": "sailtech_default",
          "id": "8f1d4e09447a973e4225ba5262e4405722c480c42dcf70da2934fae2e9c1a91b",
          "driver": "bridge",
          "network_interface": "podman2",
          "created": "2024-06-18T23:07:06.718877522-04:00",
          "subnets": [
               {
                    "subnet": "10.89.1.0/24",
                    "gateway": "10.89.1.1"
               }
          ],
          "ipv6_enabled": false,
          "internal": false,
          "dns_enabled": true,
          "labels": {
               "com.docker.compose.project": "sailtech",
               "io.podman.compose.project": "sailtech"
          },
          "ipam_options": {
               "driver": "host-local"
          }
     }
]

it looks like the compose creates a bridge network ignoring the default setting to pasta.

the addition to compose file :

networks:
   default:
     mode: pasta

has no bearing on the execution result.

Expected behavior
i expect the compose to use the (default) pasta network

Actual behavior
it doesn't

@az-z az-z added the bug Something isn't working label Jun 19, 2024
@az-z az-z changed the title compose does not use default pasta netowrk compose does not use pasta network Jun 19, 2024
@jjhidalgar
Copy link

Same issue here, I'm having issues creating rootless containers because (i think) of this error.

netavark: code: 3, msg: modprobe: ERROR: could not insert 'ip_tables': Operation not permitted
iptables v1.8.10 (legacy): can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

@jjhidalgar
Copy link

I also found that this issue happens with podman as well, without compose

This works:

podman run -d -p 8000:8000/udp ubuntu:latest sleep infinity

This doesn't work:

podman network create infra
podman run --network=infra -d -p 8000:8000/udp ubuntu:latest sleep infinity
Error: netavark: iptables: No such file or directory (os error 2)

@az-z
Copy link
Author

az-z commented Oct 15, 2024 via email

@jjhidalgar
Copy link

Well, you are right in that, but it's still confusing.

So, if I configure the system as this using root:

dnf install netavark # this would also install dependencies: iptables-libs, iptables-legacy and iptables-legacy-libs
modprobe ip_tables

Then, it works, but I'm not sure if it's using Pasta

podman inspect 28c2d0e259f2acc96287552db59d7bd788b140fcfb818fe9b17a81cf30c2a9c4 | grep Net
          "NetworkSettings": {
               "Networks": {
                         "NetworkID": "infra",
               "NetworkMode": "bridge",

@az-z
Copy link
Author

az-z commented Oct 15, 2024 via email

@jjhidalgar
Copy link

jjhidalgar commented Oct 15, 2024

I think that your description is accurate. It's basically working (if you have the right packages, which I was missing in my first experiments -iptables and ip_tables kernel module-), but it doesn't use pasta when creating a network or using compose.

@az-z
Copy link
Author

az-z commented Oct 15, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants