I’m tying to use the ipvlan cni plugin in a job but the job always reports that the network can’t be found.
client.driver_mgr.docker: failed to start container: driver=docker container_id=b7a91dd1c958606bb2f75cc3f803d1a0df9e415740a3bbf60a1e705716a13457 attempt=1 error="API error (404): network cni/pub not found"
Nomad detects the interface:
2024-02-25T15:53:11.359-0800 [DEBUG] client.fingerprint_mgr: detected CNI network: name=pub
But it always fails to find it.
Here’s my cni plugin config:
{
"cniVersion": "0.4.0",
"name": "pub",
"disableCheck": true,
"plugins": [
{
"type": "ipvlan",
"master": "eth1",
"ipam": {
"type": "static",
"addresses":
[
{
"address": "10.10.30.150/24",
"gateway": "10.10.30.1"
}],
"routes" : [
{ "dst": "0.0.0.0" }
],
"dns": {
"nameservers" : ["10.10.30.121"],
"domain": "example.com",
"search": [ "example.com" ]
}
}
},
{
"type": "portmap",
"capabilities": { "portMappings": true },
"snat": true
}
]
}
I’ve tried specifying the cni network in my job in multiple ways:
group "test" {
count = 1
network {
mode = "cni/pub"
And like this:
task "test-ipvlan" {
driver = "docker"
config {
network_mode = "cni/pub"
It does work if I create the pub network manually using ‘docker network create’.
This happens with any cni network or network type that I define (ipvlan, bridge, dhcp are the ones that I’ve tried).
I’m pretty sure that I’m missing something pretty simple here.