Skip to content

Commit

Permalink
sys-cluster/kubernetes: 1.16.x revbumps for logrotate config change
Browse files Browse the repository at this point in the history
Bug: https://bugs.gentoo.org/731130
Signed-off-by: William Hubbs <[email protected]>
  • Loading branch information
williamh committed Jul 13, 2020
1 parent e011dc1 commit 282cc46
Show file tree
Hide file tree
Showing 2 changed files with 180 additions and 0 deletions.
90 changes: 90 additions & 0 deletions sys-cluster/kubernetes/kubernetes-1.16.11-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit bash-completion-r1 go-module systemd

DESCRIPTION="production-grade container orchestration"
HOMEPAGE="https://kubernetes.io"
SRC_URI="https://github.com/kubernetes/kubernetes/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64"

AGENT="kubelet"
CLI="kubeadm kubectl"
SERVICES="kube-apiserver kube-controller-manager kube-proxy kube-scheduler"
IUSE="hardened"
for x in ${AGENT} ${CLI} ${SERVICES}; do
IUSE+=" +${x}"
done

BDEPEND=">=dev-lang/go-1.13"
COMMON_DEPEND="
kube-apiserver? (
acct-group/kube-apiserver
acct-user/kube-apiserver
)
kube-controller-manager? (
acct-group/kube-controller-manager
acct-user/kube-controller-manager
)
kube-scheduler? (
acct-group/kube-scheduler
acct-user/kube-scheduler
)"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}
kube-proxy? ( net-firewall/conntrack-tools )
!sys-cluster/kubeadm
!sys-cluster/kubectl
!sys-cluster/kubelet
!sys-cluster/kube-apiserver
!sys-cluster/kube-controller-manager
!sys-cluster/kube-proxy
!sys-cluster/kube-scheduler"

RESTRICT+=" test"

src_compile() {
local x
for x in ${AGENT} ${CLI} ${SERVICES}; do
use $x || continue
CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')" \
emake -j1 GOFLAGS=-v GOLDFLAGS="" LDFLAGS="" WHAT=cmd/${x}
done
}

src_install() {
local x
for x in ${AGENT} ${CLI} ${SERVICES}; do
use $x || continue
dobin _output/bin/${x}
if has ${x} ${CLI}; then
_output/bin/${x} completion bash > ${x}.bash || die
_output/bin/${x} completion zsh > ${x}.zsh || die
newbashcomp ${x}.bash ${x}
insinto /usr/share/zsh/site-functions
newins ${x}.zsh _${x}
continue
fi
newinitd "${FILESDIR}"/${x}.initd ${x}
newconfd "${FILESDIR}"/${x}.confd ${x}
insinto /etc/logrotate.d
newins "${FILESDIR}"/${x}.logrotated ${x}
keepdir /var/log/${x}
if [[ "$x" =~ kubelet ]]; then
systemd_dounit "${FILESDIR}"/${x}.service
insinto /etc/kubernetes
newins "${FILESDIR}"/${x}.env ${x}.env
keepdir /etc/kubernetes/manifests
fi
if [[ $x =~ kubelet|kube-proxy ]]; then
keepdir /var/lib/${x}
fi
if [[ $x =~ .*apiserver|.*controller-manager|.*scheduler ]]; then
fowners ${x}:${x} /var/log/${x}
fi
done
}
90 changes: 90 additions & 0 deletions sys-cluster/kubernetes/kubernetes-1.16.12-r1.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7
inherit bash-completion-r1 go-module systemd

DESCRIPTION="production-grade container orchestration"
HOMEPAGE="https://kubernetes.io"
SRC_URI="https://github.com/kubernetes/kubernetes/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

AGENT="kubelet"
CLI="kubeadm kubectl"
SERVICES="kube-apiserver kube-controller-manager kube-proxy kube-scheduler"
IUSE="hardened"
for x in ${AGENT} ${CLI} ${SERVICES}; do
IUSE+=" +${x}"
done

BDEPEND=">=dev-lang/go-1.13"
COMMON_DEPEND="
kube-apiserver? (
acct-group/kube-apiserver
acct-user/kube-apiserver
)
kube-controller-manager? (
acct-group/kube-controller-manager
acct-user/kube-controller-manager
)
kube-scheduler? (
acct-group/kube-scheduler
acct-user/kube-scheduler
)"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}
kube-proxy? ( net-firewall/conntrack-tools )
!sys-cluster/kubeadm
!sys-cluster/kubectl
!sys-cluster/kubelet
!sys-cluster/kube-apiserver
!sys-cluster/kube-controller-manager
!sys-cluster/kube-proxy
!sys-cluster/kube-scheduler"

RESTRICT+=" test"

src_compile() {
local x
for x in ${AGENT} ${CLI} ${SERVICES}; do
use $x || continue
CGO_LDFLAGS="$(usex hardened '-fno-PIC ' '')" \
emake -j1 GOFLAGS=-v GOLDFLAGS="" LDFLAGS="" WHAT=cmd/${x}
done
}

src_install() {
local x
for x in ${AGENT} ${CLI} ${SERVICES}; do
use $x || continue
dobin _output/bin/${x}
if has ${x} ${CLI}; then
_output/bin/${x} completion bash > ${x}.bash || die
_output/bin/${x} completion zsh > ${x}.zsh || die
newbashcomp ${x}.bash ${x}
insinto /usr/share/zsh/site-functions
newins ${x}.zsh _${x}
continue
fi
newinitd "${FILESDIR}"/${x}.initd ${x}
newconfd "${FILESDIR}"/${x}.confd ${x}
insinto /etc/logrotate.d
newins "${FILESDIR}"/${x}.logrotated ${x}
keepdir /var/log/${x}
if [[ "$x" =~ kubelet ]]; then
systemd_dounit "${FILESDIR}"/${x}.service
insinto /etc/kubernetes
newins "${FILESDIR}"/${x}.env ${x}.env
keepdir /etc/kubernetes/manifests
fi
if [[ $x =~ kubelet|kube-proxy ]]; then
keepdir /var/lib/${x}
fi
if [[ $x =~ .*apiserver|.*controller-manager|.*scheduler ]]; then
fowners ${x}:${x} /var/log/${x}
fi
done
}

0 comments on commit 282cc46

Please sign in to comment.