blob: 29bdc819e99c9b80dec42fcae3d67b960fd54026 [file] [log] [blame]
#
# Copyright 2021 Google LLC
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
EAPI=7
inherit systemd create-overlay tmpfiles
DESCRIPTION="Kubernetes package for node"
HOMEPAGE="https://github.com/GoogleCloudPlatform/kubernetes"
VERSION=1.28.7-gke.1700
SRC_URI="gs://chromeos-localmirror-private/distfiles/kubernetes-node-linux-${ARCH}-v${VERSION}.tar.gz"
LICENSE="BSD-Google"
SLOT="0"
KEYWORDS="*"
RESTRICT="mirror"
# Default S=${WORKDIR}/${PV} but tarball does stores the binaries in a kubernetes folder.
S="${WORKDIR}/${PN}"
RDEPEND="
app-arch/gzip
>=net-misc/socat-1.7.3.0
app-admin/logrotate
acct-user/prodbin
"
src_install() {
dobin node/bin/kubelet
dobin node/bin/kubectl
dobin node/bin/kubeadm
insinto /etc/default
newins "${FILESDIR}"/kubelet.env kubelet
insinto /etc/sysctl.d
newins "${FILESDIR}"/sysctl.conf 10-k8s.conf
insinto /etc/cni/net.d
newins "${FILESDIR}"/cni.conf 05-cilium.conf
insinto /etc/modules-load.d
doins "${FILESDIR}"/br_netfilter.conf
insinto /etc/systemd/networkd.conf.d
doins "${FILESDIR}"/10-kubernetes.conf
insinto /usr/lib/tmpfiles.d
doins "${FILESDIR}"/kubelet.conf
insinto /etc/iproute2/rt_tables.d
doins "${FILESDIR}"/kubernetes-routing.conf
# mount path owner:group mode backing-root
create_stateful_overlay /opt - - -
create_stateful_overlay /etc/kubernetes root:prodbin 775 -
create_stateful_overlay /etc/common_webhooks root:prodbin 775 -
create_stateful_overlay /etc/srv/kubernetes root:prodbin 775 -
create_stateful_overlay /etc/cni - - -
create_stateful_overlay /etc/containerd - - -
create_stateful_overlay /usr/libexec/kubernetes - - -
systemd_dounit "${FILESDIR}"/kubelet.service
systemd_dounit "${FILESDIR}"/kubelet-watcher.path
systemd_dounit "${FILESDIR}"/kubelet-watcher.service
systemd_enable_service multi-user.target kubelet.service
systemd_enable_service multi-user.target kubelet-watcher.path
dotmpfiles "${FILESDIR}"/kubernetes-tmpfiles.conf
}
pkg_postinst() {
tmpfiles_process kubernetes-tmpfiles.conf
}
# Change this line so that new changes will be picked up:
# Next prime number: 3