summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/meta-virt-container-cfg.bbclass6
-rw-r--r--conf/distro/include/meta-virt-container.inc40
-rw-r--r--conf/layer.conf2
3 files changed, 48 insertions, 0 deletions
diff --git a/classes/meta-virt-container-cfg.bbclass b/classes/meta-virt-container-cfg.bbclass
new file mode 100644
index 00000000..0688f525
--- /dev/null
+++ b/classes/meta-virt-container-cfg.bbclass
@@ -0,0 +1,6 @@
1# We need to set the Xen meta-virt config components, only if "xen"
2# is in the distro features. Since we don't know the distro flags during
3# layer.conf load time, we delay using a special bbclass that simply includes
4# the META_VIRT_CONTAINER_CONFIG_PATH file.
5
6include ${@bb.utils.contains('DISTRO_FEATURES', 'virtualization', '${META_VIRT_CONTAINER_CONFIG_PATH}', '', d)}
diff --git a/conf/distro/include/meta-virt-container.inc b/conf/distro/include/meta-virt-container.inc
new file mode 100644
index 00000000..c3ac8394
--- /dev/null
+++ b/conf/distro/include/meta-virt-container.inc
@@ -0,0 +1,40 @@
1# These variables represent groupings of functionality in the CNCF
2# landscape. In particular, they are areas where there is a choice
3# between more than one implementation or an area where abstraction
4# is beneficial.
5#
6# The contents of the variables are are runtime components that
7# recipes may use for RDEPENDS.
8#
9# Build dependencies are not typically flexible, so do not currently
10# have DEPENDS equivalents for the components (i.e. DEPENDS on runc
11# versus crun).
12#
13# Distro features such as kubernetes or other container stacks
14# can be used to set different defaults for these variables.
15#
16# Note: these are "global" values, since they represent choices.
17# If more than of a grouping is required on target, then the variable
18# can be appended or set to multiple values. That being said, Recipes
19# should generally agree on the values, hence the global namespace.
20# Recipe specific choices can still be done, but they risk
21# conflicting on target or causing runtime issues / errors.
22#
23
24## CNCF "components"
25
26# engines: docker-ce/docker-moby, virtual-containerd, cri-o, podman
27VIRTUAL-RUNTIME_container_engine ??= "podman"
28# runtime: runc, crun, runv, runx
29VIRTUAL-RUNTIME_container_runtime ??= "virtual-runc"
30# networking: cni, netavark
31VIRTUAL-RUNTIME_container_networking ??= "cni"
32# dns: cni, aardvark-dns
33VIRTUAL-RUNTIME_container_dns ??= "cni"
34# orchestration: k8s, k3s
35VIRTUAL-RUNTIME_container_orchestration ??= "k3s"
36
37## Kubernetes terminology "components"
38
39VIRTUAL-RUNTIME_cri ??= "virtual-containerd"
40VIRTUAL-RUNTIME_cni ??= "cni"
diff --git a/conf/layer.conf b/conf/layer.conf
index 10b457f8..88ac3905 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -52,9 +52,11 @@ INHERIT += "sanity-meta-virt"
52# layer.conf load time, we delay using a special bbclass that simply includes 52# layer.conf load time, we delay using a special bbclass that simply includes
53# the META_VIRT_CONFIG_PATH file, and likewise for the Xen and k8s configs 53# the META_VIRT_CONFIG_PATH file, and likewise for the Xen and k8s configs
54META_VIRT_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-default-versions.inc" 54META_VIRT_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-default-versions.inc"
55META_VIRT_CONTAINER_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-container.inc"
55META_VIRT_XEN_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-xen.inc" 56META_VIRT_XEN_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-xen.inc"
56K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc" 57K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc"
57USER_CLASSES:append = " meta-virt-cfg" 58USER_CLASSES:append = " meta-virt-cfg"
59USER_CLASSES:append = " meta-virt-container-cfg"
58USER_CLASSES:append = " meta-virt-k8s-cfg" 60USER_CLASSES:append = " meta-virt-k8s-cfg"
59USER_CLASSES:append = " meta-virt-xen-cfg" 61USER_CLASSES:append = " meta-virt-xen-cfg"
60USER_CLASSES:append = " meta-virt-hosts" 62USER_CLASSES:append = " meta-virt-hosts"