#3755·weave

Using weave with podman

Author: chminngiCreated Jan 17, 2020Updated Jan 24, 2024

Is there a chance to use weave CNI plugin with podman?

I tried to start weaveexec with sudo podman --log-level debug run --rm --privileged --net host --pid host -v /:/host -e HOST_ROOT=/host -e DOCKERHUB_USER=weaveworks -e WEAVE_VERSION -e WEAVE_DEBUG -e WEAVE_DOCKER_ARGS -e WEAVE_PASSWORD -e WEAVE_PORT -e WEAVE_HTTP_ADDR -e WEAVE_STATUS_ADDR -e WEAVE_CONTAINER_NAME -e WEAVE_MTU -e WEAVE_NO_FASTDP -e WEAVE_NO_BRIDGED_FASTDP -e DOCKER_BRIDGE -e DOCKER_CLIENT_HOST= -e DOCKER_CLIENT_ARGS -e PROXY_HOST=127.0.0.1 -e COVERAGE -e CHECKPOINT_DISABLE -e AWSVPC weaveworks/weaveexec:2.5.2 --local launch

Got Failed to get netdev for "docker0" bridge: Link not found

Here an excerpt of the debug log:

bash
INFO[0000] Running conmon under slice machine.slice and unitName libpod-conmon-04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de.scope 
DEBU[0000] Received: 581                                
INFO[0000] Got Conmon PID as 553                        
DEBU[0000] Created container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de in OCI runtime 
DEBU[0000] Attaching to container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de 
DEBU[0000] connecting to socket /var/run/libpod/socket/04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de/attach 
DEBU[0000] Starting container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de with command [/home/weave/sigproxy /home/weave/weave --local launch] 
DEBU[0000] Started container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de 
DEBU[0000] Enabling signal proxying                     
Failed to get netdev for "docker0" bridge: Link not found
DEBU[0000] Cleaning up container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de 
DEBU[0000] Network is already cleaned up, skipping...   
DEBU[0000] unmounted container "04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de" 
DEBU[0000] Successfully cleaned up container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de 
DEBU[0000] Container 04a0eac0f55ed48d5e8cb5bc79f9852dce09a40101024ce5fa77478aa95774de storage is already unmounted, skipping... 
DEBU[0000] [graphdriver] trying provided driver "overlay" 
DEBU[0000] cached value indicated that overlay is supported 
DEBU[0000] cached value indicated that metacopy is not being used 
DEBU[0000] backingFs=extfs, projectQuotaSupported=false, useNativeDiff=true, usingMetacopy=false

Here my images:

bash
$ sudo podman images
REPOSITORY                       TAG      IMAGE ID       CREATED        SIZE
docker.io/library/alpine         latest   e9a72a7c189c   3 weeks ago    5.61 MB
docker.io/weaveworks/weavedb     latest   6898eac75586   2 months ago   6.42 kB
docker.io/weaveworks/weaveexec   2.5.2    429ac05cb8ee   8 months ago   167 MB
docker.io/weaveworks/weave       2.5.2    d2dc0122f4e3   8 months ago   115 MB
k8s.gcr.io/pause  

Here the defined rootful networks:

bash
$ sudo podman network ls
NAME     VERSION   PLUGINS
weave    0.3.0     weave-net,portmap
podman   0.4.0     bridge,portmap,firewall

Here the content of /etc/cni/net.d/10-weave.conflist:

bash
$ cat 10-weave.conflist 
{
    "cniVersion": "0.3.0",
    "name": "weave",
    "plugins": [
        {
            "name": "weave",
            "type": "weave-net",
            "hairpinMode": true
        },
        {
            "type": "portmap",
            "capabilities": {"portMappings": true},
            "snat": true
        }
    ]
}

Here the libpod config file:

NOTE: I changed the container runtime runc with crun (!)

bash
$ cat /home/podman/.config/containers/libpod.conf
volume_path = "/home/podman/.local/share/containers/storage/volumes"                                                                                           
image_default_transport = "docker://"                                                                                                                          
runtime = "crun"                                                                                                                                               
runtime_supports_json = ["crun"]                                                                                                                               
runtime_supports_nocgroups = ["crun"]                                                                                                                          
conmon_path = ["/usr/libexec/podman/conmon", "/usr/local/libexec/podman/conmon", "/usr/local/lib/podman/conmon", "/usr/bin/conmon", "/usr/sbin/conmon", "/usr/local/bin/conmon", "/usr/local/sbin/conmon", "/run/current-system/sw/bin/conmon"]                                                                               
conmon_env_vars = ["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"]                                                                        
cgroup_manager = "cgroupfs"                                                                                                                                    
init_path = ""                                                                                                                                                 
static_dir = "/home/podman/.local/share/containers/storage/libpod"                                                                                             
tmp_dir = "/run/user/1000/libpod/tmp"                                                                                                                          
max_log_size = -1                                                                                                                                              
no_pivot_root = false                                                                                                                                          
cni_config_dir = "/etc/cni/net.d/"                                                                                                                             
cni_plugin_dir = ["/usr/libexec/cni", "/usr/lib/cni", "/usr/local/lib/cni", "/opt/cni/bin"]                                                                    
infra_image = "k8s.gcr.io/pause:3.1"                                                                                                                           
infra_command = "/pause"                                                                                                                                       
enable_port_reservation = true                                                                                                                                 
label = true                                                                                                                                                   
network_cmd_path = ""                                                                                                                                          
num_locks = 2048                                                                                                                                               
lock_type = "shm"                                                                                                                                              
events_logger = "journald"                                                                                                                                     
events_logfile_path = ""                                                                                                                                       
detach_keys = "ctrl-p,ctrl-q"                                                                                                                                  
SDNotify = false                                                                                                                                               
                                                                                                                                                               
[runtimes]                                                                                                                                                     
  crun = ["/usr/bin/crun", "/usr/local/bin/crun"]

Should I define a custom bridge called docker0?