summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2017-10-05 11:11:01 -0400
committerBruce Ashfield <bruce.ashfield@windriver.com>2017-10-05 11:11:01 -0400
commit9d4da563b0c6adb8cccbdae3e32e1a4be2fde96f (patch)
tree81866499d810ab35ea721fe60adacb7e52b3bd33
parentfdee07aadc1b5224a540c7e8893144207e1979cb (diff)
downloadmeta-virtualization-9d4da563b0c6adb8cccbdae3e32e1a4be2fde96f.tar.gz
containers: introduce kubernetes orchestration
Introducing the kubernets components for container orchestration. The packaging introduced here creates the framework for more advanced kubernetes configurations. By itself, it doesn't do much but it makes the components available to be configured and deployed as master/worker nodes. It integrates with the previously introduced cni and cri-o components available in meta-virt. Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r--recipes-containers/kubernetes/kubernetes_git.bb98
1 files changed, 98 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/kubernetes_git.bb b/recipes-containers/kubernetes/kubernetes_git.bb
new file mode 100644
index 00000000..f574a3e2
--- /dev/null
+++ b/recipes-containers/kubernetes/kubernetes_git.bb
@@ -0,0 +1,98 @@
1HOMEPAGE = "git://github.com/kubernetes/kubernetes"
2SUMMARY = "Production-Grade Container Scheduling and Management"
3DESCRIPTION = "Kubernetes is an open source system for managing containerized \
4applications across multiple hosts, providing basic mechanisms for deployment, \
5maintenance, and scaling of applications. \
6"
7
8SRCREV_kubernetes = "4b839465f84e7faf876c51703aaf49b37fd10d9c"
9SRC_URI = "git://github.com/kubernetes/kubernetes.git;nobranch=1;name=kubernetes \
10 "
11
12DEPENDS += "rsync-native \
13 coreutils-native \
14 "
15
16PACKAGES =+ "kubeadm"
17PACKAGES =+ "kubectl"
18PACKAGES =+ "kubelet"
19
20ALLOW_EMPTY_${PN} = "1"
21
22# Note: we are explicitly *not* adding docker to the rdepends, since we allow
23# backends like cri-o to be used.
24RDEPENDS_${PN} += "kubeadm \
25 kubectl \
26 kubelet \
27 cni"
28
29RDEPENDS_kubeadm = "kubelet kubectl"
30RDEPENDS_kubelet = "iptables socat util-linux ethtool iproute2 ebtables"
31
32LICENSE = "Apache-2.0"
33LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
34
35GO_IMPORT = "import"
36
37PV = "1.9.0-alpha.1+git${SRCREV_kubernetes}"
38
39inherit systemd
40inherit go
41inherit goarch
42
43do_compile() {
44 export GOARCH="${TARGET_GOARCH}"
45 export GOROOT="${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go"
46 export GOPATH="${S}/src/import:${S}/src/import/vendor"
47
48 # Pass the needed cflags/ldflags so that cgo
49 # can find the needed headers files and libraries
50 export CGO_ENABLED="1"
51 export CFLAGS=""
52 export LDFLAGS=""
53 export CGO_CFLAGS="${BUILDSDK_CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
54 export CGO_LDFLAGS="${BUILDSDK_LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
55
56 # link fixups for compilation
57 rm -f ${S}/src/import/vendor/src
58 ln -sf ./ ${S}/src/import/vendor/src
59
60 export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
61 export GOROOT="${STAGING_DIR_NATIVE}/${nonarch_libdir}/${HOST_SYS}/go"
62
63 # Pass the needed cflags/ldflags so that cgo
64 # can find the needed headers files and libraries
65 export CGO_ENABLED="1"
66 export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
67 export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
68
69 cd ${S}/src/import
70 # to limit what is built, use 'WHAT', i.e. make WHAT=cmd/kubelet
71 make all
72}
73
74do_install() {
75 install -d ${D}${bindir}
76 install -d ${D}${systemd_unitdir}/system/
77 install -d ${D}${systemd_unitdir}/system/kubelet.service.d/
78
79 install -d ${sysconfdir}/kubernetes/manifests/
80
81 install -m 755 -D ${S}/src/import/_output/bin/kube* ${D}/${bindir}
82
83 install -m 0644 ${S}/src/import/build/debs/kubelet.service ${D}${systemd_unitdir}/system/
84 install -m 0644 ${S}/src/import/build/debs/10-kubeadm.conf ${D}${systemd_unitdir}/system/kubelet.service.d/
85}
86
87SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet','',d)}"
88SYSTEMD_SERVICE_kubelet = "${@bb.utils.contains('DISTRO_FEATURES','systemd','kubelet.service','',d)}"
89SYSTEMD_AUTO_ENABLE_kubelet = "enable"
90
91FILES_kubeadm = "${bindir}/kubeadm ${systemd_unitdir}/system/kubelet.service.d/*"
92FILES_kubectl = "${bindir}/kubectl"
93FILES_kubelet = "${bindir}/kubelet ${systemd_unitdir}/system/kubelet.service ${sysconfdir}/kubernetes/manifests/"
94
95INHIBIT_PACKAGE_STRIP = "1"
96INSANE_SKIP_${PN} += "ldflags already-stripped"
97
98deltask compile_ptest_base