2 ## Copyright (C) 2019 Wind River Systems, Inc.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
16 FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
17 PV = "1.16.2+git${SRCREV_kubernetes}"
18 SRCREV_kubernetes = "c97fe5036ef3df2967d086711e6c0c405941e14b"
20 SRC_URI = "git://github.com/kubernetes/kubernetes.git;branch=release-1.16;name=kubernetes \
21 file://0001-hack-lib-golang.sh-use-CC-from-environment.patch \
22 file://0001-cross-don-t-build-tests-by-default.patch \
23 file://kubernetes-accounting.conf \
25 file://kubelet-cgroup-setup.sh \
29 INSANE_SKIP_${PN} += "textrel"
30 INSANE_SKIP_${PN}-misc += "textrel"
31 INSANE_SKIP_kubelet += "textrel"
35 USERADD_PACKAGES = "${PN}"
36 USERADD_PARAM_${PN} = "-r -g kube -d / -s /sbin/nologin -c 'Kubernetes user' kube"
37 GROUPADD_PARAM_${PN} = "-r kube"
40 install -d ${D}${bindir}
41 install -d ${D}${systemd_system_unitdir}/
44 install -m 755 -D ${S}/src/import/_output/local/bin/${TARGET_GOOS}/${TARGET_GOARCH}/* ${D}/${bindir}
47 install -d -m 0755 ${D}/${sysconfdir}/systemd/system/kubelet.service.d
48 install -m 0644 ${WORKDIR}/kubeadm.conf ${D}/${sysconfdir}/systemd/system/kubelet.service.d
50 # kubelete-cgroup-setup.sh
51 install -m 0700 ${WORKDIR}/kubelet-cgroup-setup.sh ${D}/${bindir}
53 # install the bash completion
54 install -d -m 0755 ${D}${datadir}/bash-completion/completions/
55 ${D}${bindir}/kubectl completion bash > ${D}${datadir}/bash-completion/completions/kubectl
57 # install config files
58 install -d -m 0755 ${D}${sysconfdir}/${BPN}
59 install -m 644 -t ${D}${sysconfdir}/${BPN} ${WORKDIR}/contrib/init/systemd/environ/*
61 # install service files
62 install -d -m 0755 ${D}${systemd_system_unitdir}
63 install -m 0644 -t ${D}${systemd_system_unitdir} ${WORKDIR}/contrib/init/systemd/*.service
65 # install the place the kubelet defaults to put volumes
66 install -d ${D}${localstatedir}/lib/kubelet
68 # install systemd tmpfiles
69 install -d -m 0755 ${D}${sysconfdir}/tmpfiles.d
70 install -p -m 0644 -t ${D}${sysconfdir}/tmpfiles.d ${WORKDIR}/contrib/init/systemd/tmpfiles.d/kubernetes.conf
72 # enable CPU and Memory accounting
73 install -d -m 0755 ${D}/${sysconfdir}/systemd/system.conf.d
74 install -m 0644 ${WORKDIR}/kubernetes-accounting.conf ${D}/${sysconfdir}//systemd/system.conf.d/
77 SYSTEMD_PACKAGES += "${PN} kube-proxy"
78 SYSTEMD_SERVICE_kube-proxy = "kube-proxy.service"
79 SYSTEMD_SERVICE_${PN} = "\
80 kube-scheduler.service \
81 kube-apiserver.service \
82 kube-controller-manager.service \
84 SYSTEMD_AUTO_ENABLE_${PN} = "disable"
85 SYSTEMD_AUTO_ENABLE_kubelet = "disable"
86 SYSTEMD_AUTO_ENABLE_kube-proxy = "disable"
89 ${bindir}/kube-scheduler \
90 ${bindir}/kube-apiserver \
91 ${bindir}/kube-controller-manager \
93 ${bindir}/kubelet-cgroup-setup.sh \
97 ${datadir}/bash-completion/completions/kubectl \
100 FILES_${PN}-misc = "\
101 ${bindir}/conversion-gen \
102 ${bindir}/openapi-gen \
103 ${bindir}/apiextensions-apiserver \
104 ${bindir}/defaulter-gen \
106 ${bindir}/deepcopy-gen \
107 ${bindir}/go-bindata \