diff options
-rw-r--r-- | classes/meta-virt-container-cfg.bbclass | 6 | ||||
-rw-r--r-- | conf/distro/include/meta-virt-container.inc | 40 | ||||
-rw-r--r-- | conf/layer.conf | 2 |
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 | |||
6 | include ${@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 | ||
27 | VIRTUAL-RUNTIME_container_engine ??= "podman" | ||
28 | # runtime: runc, crun, runv, runx | ||
29 | VIRTUAL-RUNTIME_container_runtime ??= "virtual-runc" | ||
30 | # networking: cni, netavark | ||
31 | VIRTUAL-RUNTIME_container_networking ??= "cni" | ||
32 | # dns: cni, aardvark-dns | ||
33 | VIRTUAL-RUNTIME_container_dns ??= "cni" | ||
34 | # orchestration: k8s, k3s | ||
35 | VIRTUAL-RUNTIME_container_orchestration ??= "k3s" | ||
36 | |||
37 | ## Kubernetes terminology "components" | ||
38 | |||
39 | VIRTUAL-RUNTIME_cri ??= "virtual-containerd" | ||
40 | VIRTUAL-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 |
54 | META_VIRT_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-default-versions.inc" | 54 | META_VIRT_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-default-versions.inc" |
55 | META_VIRT_CONTAINER_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-container.inc" | ||
55 | META_VIRT_XEN_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-xen.inc" | 56 | META_VIRT_XEN_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/meta-virt-xen.inc" |
56 | K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc" | 57 | K8S_CONFIG_PATH = "${LAYERDIR}/conf/distro/include/k8s-versions.inc" |
57 | USER_CLASSES:append = " meta-virt-cfg" | 58 | USER_CLASSES:append = " meta-virt-cfg" |
59 | USER_CLASSES:append = " meta-virt-container-cfg" | ||
58 | USER_CLASSES:append = " meta-virt-k8s-cfg" | 60 | USER_CLASSES:append = " meta-virt-k8s-cfg" |
59 | USER_CLASSES:append = " meta-virt-xen-cfg" | 61 | USER_CLASSES:append = " meta-virt-xen-cfg" |
60 | USER_CLASSES:append = " meta-virt-hosts" | 62 | USER_CLASSES:append = " meta-virt-hosts" |