diff options
| author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-12-15 12:56:28 -0500 |
|---|---|---|
| committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2021-12-15 12:59:12 -0500 |
| commit | 14025b2ee5a0a6d9996002325685add2a646a9f3 (patch) | |
| tree | dc849caa6b357e11c394044b35cb5c3837e77f51 | |
| parent | 5b3b2599db1929b6c330ffc45f0f37d7c0ad0aa2 (diff) | |
| download | meta-virtualization-14025b2ee5a0a6d9996002325685add2a646a9f3.tar.gz | |
kubernetes: add sysctl.d configuration
The startup of kubernetes relies on some kernel/runtime configuration.
We create a sysctl.d snippet to ensure that critical ones are set when
installing our packages.
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
| -rw-r--r-- | recipes-containers/kubernetes/kubernetes/99-kubernetes.conf | 1 | ||||
| -rw-r--r-- | recipes-containers/kubernetes/kubernetes_git.bb | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/recipes-containers/kubernetes/kubernetes/99-kubernetes.conf b/recipes-containers/kubernetes/kubernetes/99-kubernetes.conf new file mode 100644 index 00000000..89331ca2 --- /dev/null +++ b/recipes-containers/kubernetes/kubernetes/99-kubernetes.conf | |||
| @@ -0,0 +1 @@ | |||
| net.ipv4.ip_forward = 1 | |||
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb index 7cdef2c7..949f3076 100644 --- a/recipes-containers/kubernetes/kubernetes_git.bb +++ b/recipes-containers/kubernetes/kubernetes_git.bb | |||
| @@ -32,6 +32,7 @@ SRC_URI:append = " \ | |||
| 32 | file://0001-Makefile.generated_files-Fix-race-issue-for-installi.patch \ | 32 | file://0001-Makefile.generated_files-Fix-race-issue-for-installi.patch \ |
| 33 | file://cni-containerd-net.conflist \ | 33 | file://cni-containerd-net.conflist \ |
| 34 | file://k8s-init \ | 34 | file://k8s-init \ |
| 35 | file://99-kubernetes.conf \ | ||
| 35 | " | 36 | " |
| 36 | 37 | ||
| 37 | DEPENDS += "rsync-native \ | 38 | DEPENDS += "rsync-native \ |
| @@ -105,6 +106,9 @@ do_install() { | |||
| 105 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then | 106 | if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then |
| 106 | install -d "${D}${BIN_PREFIX}/bin" | 107 | install -d "${D}${BIN_PREFIX}/bin" |
| 107 | install -m 755 "${WORKDIR}/k8s-init" "${D}${BIN_PREFIX}/bin" | 108 | install -m 755 "${WORKDIR}/k8s-init" "${D}${BIN_PREFIX}/bin" |
| 109 | |||
| 110 | install -d ${D}${sysconfdir}/sysctl.d | ||
| 111 | install -m 0644 "${WORKDIR}/99-kubernetes.conf" "${D}${sysconfdir}/sysctl.d" | ||
| 108 | fi | 112 | fi |
| 109 | } | 113 | } |
| 110 | 114 | ||
| @@ -135,7 +139,7 @@ SYSTEMD_AUTO_ENABLE:kubelet = "enable" | |||
| 135 | 139 | ||
| 136 | FILES:kubectl = "${bindir}/kubectl" | 140 | FILES:kubectl = "${bindir}/kubectl" |
| 137 | FILES:kube-proxy = "${bindir}/kube-proxy" | 141 | FILES:kube-proxy = "${bindir}/kube-proxy" |
| 138 | FILES:${PN}-misc = "${bindir}" | 142 | FILES:${PN}-misc = "${bindir} ${sysconfdir}/sysctl.d" |
| 139 | 143 | ||
| 140 | ALLOW_EMPTY:${PN}-host = "1" | 144 | ALLOW_EMPTY:${PN}-host = "1" |
| 141 | FILE:${PN}-host = "${BIN_PREFIX}/bin/k8s-init" | 145 | FILE:${PN}-host = "${BIN_PREFIX}/bin/k8s-init" |
