summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Podshumok <kpp.live+signed@gmail.com>2019-07-21 18:01:09 +0300
committerMaxim Koltsov <maksbotan@gentoo.org>2019-08-05 22:25:00 +0300
commitc01c2d2e17fabb61fdc0595996f08043aab2003e (patch)
treef65e1903f9f80df342f9eae026b959ebb5a3e8b9 /sys-cluster/kube-router
parentsys-apps/firejail: [QA] fix compressed man pages (diff)
downloadgentoo-c01c2d2e17fabb61fdc0595996f08043aab2003e.tar.gz
gentoo-c01c2d2e17fabb61fdc0595996f08043aab2003e.tar.bz2
gentoo-c01c2d2e17fabb61fdc0595996f08043aab2003e.zip
sys-cluster/kube-router new ebuild
Signed-off-by: Konstantin Podshumok <kpp.live+signed@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/12494 Signed-off-by: Maxim Koltsov <maksbotan@gentoo.org>
Diffstat (limited to 'sys-cluster/kube-router')
-rw-r--r--sys-cluster/kube-router/Manifest1
-rw-r--r--sys-cluster/kube-router/files/kube-router.confd11
-rw-r--r--sys-cluster/kube-router/files/kube-router.initd22
-rw-r--r--sys-cluster/kube-router/files/kube-router.logrotated7
-rw-r--r--sys-cluster/kube-router/kube-router-0.3.1.ebuild48
-rw-r--r--sys-cluster/kube-router/metadata.xml23
6 files changed, 112 insertions, 0 deletions
diff --git a/sys-cluster/kube-router/Manifest b/sys-cluster/kube-router/Manifest
new file mode 100644
index 000000000000..16a8309e7f37
--- /dev/null
+++ b/sys-cluster/kube-router/Manifest
@@ -0,0 +1 @@
+DIST kube-router-0.3.1.tar.gz 8468463 BLAKE2B 23ee608e6415b3627f5024c8778ae1f33c5db3c1c564d0eb1e0fcb45dd90ff4a148c39e7fd0a4888d6b4cf13b129c5249c2db868efa584f15e31c7ff539829d5 SHA512 185e3a58dc6112e33ed7dc5702795dd7be0a37b63c7c882a1c092060a57a755ea4ea5c2cc96c93210bee632a4a4c4b19f3506ceb44b96d4727cf62cb2f28818f
diff --git a/sys-cluster/kube-router/files/kube-router.confd b/sys-cluster/kube-router/files/kube-router.confd
new file mode 100644
index 000000000000..4b4b600ade8e
--- /dev/null
+++ b/sys-cluster/kube-router/files/kube-router.confd
@@ -0,0 +1,11 @@
+# K8S_APISERVER='https://127.0.0.1:6443'
+# KUBECONFIG=/etc/kubernetes/kube-router.kubeconfig
+
+# Leave empty to autodetect:
+# HOSTNAME=
+
+# RUN_PROXY=true
+# RUN_FIREWALL=true
+# RUN_ROUTER=false
+
+EXTRA_ARGS=''
diff --git a/sys-cluster/kube-router/files/kube-router.initd b/sys-cluster/kube-router/files/kube-router.initd
new file mode 100644
index 000000000000..844b951bd837
--- /dev/null
+++ b/sys-cluster/kube-router/files/kube-router.initd
@@ -0,0 +1,22 @@
+#!/sbin/openrc-run
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+description="Kubernetes routing engine"
+supervisor=supervise-daemon
+command="/usr/bin/kube-router"
+error_log='/var/log/${RC_SVCNAME}/${RC_SVCNAME}.log'
+pidfile="${pidfile:-/run/${RC_SVCNAME}.pid}"
+
+command_args="--master=${K8S_APISERVER} --kubeconfig=${KUBECONFIG} \
+ --run-service-proxy=${RUN_PROXY:-false} \
+ --run-firewall=${RUN_FIREWALL:-false} \
+ --run-router=${RUN_ROUTER:-false} \
+ ${HOSTNAME:+--hostname-override=}${HOSTNAME} \
+ ${EXTRA_ARGS}"
+
+extra_commands="clear"
+
+clear() {
+ "${command}" --cleanup-config
+}
diff --git a/sys-cluster/kube-router/files/kube-router.logrotated b/sys-cluster/kube-router/files/kube-router.logrotated
new file mode 100644
index 000000000000..9b08d6715204
--- /dev/null
+++ b/sys-cluster/kube-router/files/kube-router.logrotated
@@ -0,0 +1,7 @@
+/var/log/kube-router/*.log {
+ missingok
+ size 5M
+ rotate 3
+ compress
+ copytruncate
+}
diff --git a/sys-cluster/kube-router/kube-router-0.3.1.ebuild b/sys-cluster/kube-router/kube-router-0.3.1.ebuild
new file mode 100644
index 000000000000..2d4a756b4076
--- /dev/null
+++ b/sys-cluster/kube-router/kube-router-0.3.1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+EGO_PN="github.com/cloudnativelabs/${PN}"
+
+inherit golang-build golang-vcs-snapshot
+
+KEYWORDS="~amd64"
+
+DESCRIPTION="A turnkey solution for Kubernetes networking"
+HOMEPAGE="https://kube-router.io"
+SRC_URI="https://github.com/cloudnativelabs/kube-router/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+
+RDEPEND="
+ net-firewall/iptables[conntrack]
+ net-firewall/ipset
+ sys-cluster/ipvsadm
+"
+
+src_compile() {
+ pushd src/${EGO_PN} || die
+ GOPATH="${S}" go build -x -work -v \
+ -ldflags "-X 'github.com/cloudnativelabs/kube-router/pkg/cmd.version=${PV}' "\
+"-X 'github.com/cloudnativelabs/kube-router/pkg/cmd.buildDate=$(date -u +%FT%T%z)'" \
+ -o kube-router cmd/kube-router/kube-router.go || die
+ popd || die
+}
+
+src_test() {
+ :
+}
+
+src_install() {
+ pushd src/${EGO_PN} || die
+ dobin ${PN}
+ dodoc *.md docs/*.md docs/*/*
+ popd || die
+
+ newinitd "${FILESDIR}"/kube-router.initd kube-router
+ newconfd "${FILESDIR}"/kube-router.confd kube-router
+
+ insinto /etc/logrotate.d
+ newins "${FILESDIR}"/kube-router.logrotated kube-router
+}
diff --git a/sys-cluster/kube-router/metadata.xml b/sys-cluster/kube-router/metadata.xml
new file mode 100644
index 000000000000..468a7ec1342e
--- /dev/null
+++ b/sys-cluster/kube-router/metadata.xml
@@ -0,0 +1,23 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>kpp+gentoo@qrator.net</email>
+ <name>Konstantin Ignatov</name>
+ </maintainer>
+ <maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <longdescription lang="en">
+ kube-router is an alternative to several network components used
+ in typical Kubernetes clusters.
+
+ It handles IPVS/LVS based service proxy, Pod Networking and
+ Network Policy Controller tasks using standard Linux networking
+ stack and toolset.
+ </longdescription>
+ <upstream>
+ <remote-id type="github">cloudnativelabs/kube-router</remote-id>
+ </upstream>
+</pkgmetadata>