containerd: add cni-networking configuration

When running a containerd-only stack, we need a CNI configuration
to be available.

When running containerd as part of something like K3S, we expect
the orchestration package will provide that configuration.

This commit makes a containerd-cni package available that contains
a starting point configuration.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2024-10-29 14:38:31 +00:00
parent adcb5da8b5
commit e2c3d012f9
2 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,24 @@
{
"cniVersion": "0.4.0",
"name": "containerd-net",
"plugins": [
{
"type": "bridge",
"bridge": "cni0",
"isGateway": true,
"ipMasq": true,
"promiscMode": true,
"ipam": {
"type": "host-local",
"subnet": "10.88.0.0/16",
"routes": [
{ "dst": "0.0.0.0/0" }
]
}
},
{
"type": "portmap",
"capabilities": {"portMappings": true}
}
]
}

View File

@ -9,6 +9,7 @@ SRCREV = "19430264c19b8bd9f940101ec71d52ab2d2e54d5"
SRC_URI = "git://github.com/containerd/containerd;branch=main;protocol=https;destsuffix=git/src/github.com/containerd/containerd/v2 \
file://0001-Makefile-allow-GO_BUILD_FLAGS-to-be-externally-speci.patch \
file://0001-build-don-t-use-gcflags-to-define-trimpath.patch \
file://cni-containerd-net.conf \
"
# Apache-2.0 for containerd
@ -98,3 +99,7 @@ COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
RDEPENDS:${PN} += " ${VIRTUAL-RUNTIME_container_runtime}"
## This may need to be made conditional on K3S or similar being
## configured in the distro, since we may have collisions.
CNI_NETWORKING_FILES ?= "${UNPACKDIR}/cni-containerd-net.conf"
inherit cni_networking