diff options
Diffstat (limited to 'sys-cluster/k3s')
-rw-r--r-- | sys-cluster/k3s/Manifest | 3 | ||||
-rw-r--r-- | sys-cluster/k3s/k3s-1.25.4_p1.ebuild | 102 |
2 files changed, 105 insertions, 0 deletions
diff --git a/sys-cluster/k3s/Manifest b/sys-cluster/k3s/Manifest index 568eb44f779e..d635434002b3 100644 --- a/sys-cluster/k3s/Manifest +++ b/sys-cluster/k3s/Manifest @@ -4,12 +4,15 @@ AUX k3s.logrotated 37 BLAKE2B 8e106b2ae826d1724adb3cf6970cb46b53247ce77a8206ce9f AUX k3s.service 597 BLAKE2B 067ea095d2ad948a59e6fcc6ecc569d3f8fa4e802e381e5ccc48988c70c5e8e9e4335afc7cf5a2e830d22bd89cabffbc6fb9161da73599be75b305eb28bea14a SHA512 9741575f844da8ed96e230c443ec6662bff22be8602b420eb74fc6a72d09f36a5fddb8426894e63b7a8c2918a36fc717a38dfbcf003b56f47c13c06c4fc96825 DIST k3s-1.25.2_p1-vendor.tar.gz 31890900 BLAKE2B 9a60ed25d4df0f8e2c90fe06de5b68656ce177dc5480a91272ecddbb75686ba86e61d600088a0fabeed37c1c28ec3d1ad46c514b8a248b1d0770f686da567a7a SHA512 c31098710c30b81cffbf1fd86084637c2563124e3415b8a83d428ced5e2bf81eb023de9b05a6990a2b8c236f1dab538a8f7fae6ef3105c266c40dd89c426c93a DIST k3s-1.25.3_p1-vendor.tar.gz 31914962 BLAKE2B 6c392ec4988f5c875dfe892f9f032c90936a032f4dcaefca6da304c5495c079969b9bdc8f42f888ac0d922e81b965a3b074e3e5a18a960701ca6ec96e39cdc7e SHA512 6610d5660c403ef2ec04c2d35f796e8cb7cc4f3fcf65d209c9ff5e986da14f4d8c594f60eb9e02cc873d210f69af82a41681731e2586945f6bc44bd3cc364ff8 +DIST k3s-1.25.4_p1-vendor.tar.gz 32048804 BLAKE2B 0fabf00e32b7db9f607def3a6d67b8266e96816f108be89bef499859219ca2ed26c7c4e01c2795161d8513b7c8cd55f9b6ea38f28b8536b3510fe59c86115d4f SHA512 96c157f4cb57347b3f6ac8be345fc4937aae2679b321387c263550f63b893f888df099de27606a81feaead1a8a3a3b54ed0974556666fcfe6390ddcee653a5ea DIST k3s-cni-plugins-1.1.1.tar.gz 3122345 BLAKE2B 270283ffb746ca97ad147b368143c56bd9641b7ebcb1b2b61f80ffea3336b240b28c9b9496bd2f6eb6d7e5382da4979c26e37eca30ac19fd362ed822ba94f300 SHA512 53dcd363231325553a5c9e804fc9005471fe5c05c87aae0340214c146eba66a3761d73976ba0145d86a663a2b0a1941e6cc5823b6d05e002a9ef18e41e10ac3c DIST k3s-containerd-1.6.8-k3s1.tar.gz 10344676 BLAKE2B 18b236d61c710234fc6feefb4b08e36950c02a3a74d92a7bae5286ddf2916d29f636d1c9fb4307ccb6c6f1c7a77441096b0db9c892d5745f32815f4016af7b54 SHA512 b85c5e73c9f6c66c229888d93b3796c3fa4b362ee2ee4f7fb37f760ff241223820c0bec4995e73e9c3d20b81a8fc3676e7b0ed170239c8cb43194aae2701a6b5 DIST k3s-root-amd64-0.11.0.tar 11878400 BLAKE2B 6227ba08e305f062ed814a6b997313415c08e469b05f0501c86f7df25e8a3c9ecb43675613337f6d038faa5153aae98eb44cad9bc170967e0a216ba5ec27559e SHA512 d181117230ad941b40173c3b7dc3d2bb0f3d44a28e9715d85c752193c6058bb6be4a4b8f061df73fed690629a7b2b330185b38bb90ce7fcc9c808096516cb0a3 DIST k3s-runc-v1.1.4.tar.gz 2334639 BLAKE2B bc7eb7de29e8ebb9ce146bc77bf6cfc116f4af3e28c0344059183cf0c8082c629ccb235531c368cce99915991b25df0b50b7cbb98b9c6a7d141ba6cc15958651 SHA512 c8e79ad839964680d29ab56a4de255f91192741951673025da6889c544a232d4d392db2da8005d8e22999a37bfbc9c9fe7f6043b165bc4edc2f2a29261d8a3d6 DIST traefik-10.19.3.tgz 25287 BLAKE2B c43a5e066d78e066bc4449ad1d7a3796c99c5f029244dac5494a452592424a9be057b6a3d8eddd174d8daab2b322c4f54e39eae53fba67e97e1ebdb92ce2fd65 SHA512 6df4b186c4caad09abf47469757c1d26d3b593531704af53eb262208f1efa27b5b09b178c6dd6721e78362877e6ba3b2c8c3bfbc91fe152ce090b53ac283acf9 DIST traefik-12.0.0.tgz 36268 BLAKE2B 9332e30d593c2c73cf06be8d7813807f6880e40d7f1c78f314b77e2fd2342e91f232f5288d2946eff586fc58c27fa182da30a50f37b91046d37a4aad6d3bc452 SHA512 5cd661ab609fc17c1fb52460c3d1e6ff3ee294f6dc8365b68e8a35a3e4b321b7ca75037eda2869ab72ca14836ba1c72b76d3cd92021dba56dd163b2678448dfc +DIST traefik-19.0.4.tgz 64237 BLAKE2B f9cb2ab1b72446781dc0b214b9f986629e78134ee3942ebc62d6bec43b15e1ce9dc34b8bdecfe04d198308f6fe7145e4bfcd4b6386fae50eb4bdce56751e7dc3 SHA512 575bd49371a91a0b00247ce1f72b7b87adad3d0dbfe31b4e916ca35711eb8ec39cb07bc903d2d7e44dc0f4f963303fc9169fe80c0c38f7191b13b655740b814b EBUILD k3s-1.25.2_p1.ebuild 4065 BLAKE2B b84b43937e5211584bfcdba1c7881904831956e9be40892d4957e5d69cadf499b2457f1ee88138ae7cf5ba68e2a1749c8119328228ceb3bafca59921bb816125 SHA512 5c1602435fbcbd60edd69759811d5d192d2c34122a3c448c5864a14ea658fabf070886e5aec16837b1991debd8598c0a1cf2935a9886c9943c33e12ff9312518 EBUILD k3s-1.25.3_p1.ebuild 4064 BLAKE2B b69f5b849c04841bcdb44c85e8beb94b3a747a7c0a4093e36d9fd3a1ce4fec79eab523bd9b8e41863408a0a8bbcf5f500e51b41462896c401fd61c473e543391 SHA512 3364faff5571638e171388cfe7bedd7759d8db6b951f7408fdaa80c0af11b83efa1d9f10428c24ae163cddd6ea3001e2a995fa75e069dbfc4b74500d475f37ff +EBUILD k3s-1.25.4_p1.ebuild 4073 BLAKE2B 762ee31d9dca8e07c568c1f38a4b08a61e4583162d64107e4f48fd60969580da4393426b9886808b65b3f3bafdc22b98d1ede56e29810733de22b3e3aca53978 SHA512 8c717b38ad7de50ce3dc9c4482e8d211652ce0f04441826f1186190836846d74a3526877e2cdaa71c5df3121021f53694089a988a4aa37a16285d1e83284e429 MISC metadata.xml 515 BLAKE2B dc5e9d23a7b4d84ec392036cd87975b9117133b3a68eb1a69a38637dfca36f4e721be42dbd1ee0dd73585602800ef49d4255ff736be7cdc97e7f2d07b59af99b SHA512 8ee732afdfd59151faa18dbc68075d0c528113b8ea3f9939d0a83fbf7f06deefe2dee27079b7317ee98ea165e81cf4514f1d305564e21b3e1fc4760d2350fd46 diff --git a/sys-cluster/k3s/k3s-1.25.4_p1.ebuild b/sys-cluster/k3s/k3s-1.25.4_p1.ebuild new file mode 100644 index 000000000000..993f21c2a09d --- /dev/null +++ b/sys-cluster/k3s/k3s-1.25.4_p1.ebuild @@ -0,0 +1,102 @@ +# Copyright 2021-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 +inherit go-module linux-info systemd + +DESCRIPTION="Lightweight Kubernetes" +HOMEPAGE="https://k3s.io" +K3S_CONTAINERD_VERSION=1.6.8-k3s1 +K3S_RUNC_VERSION=v1.1.4 +K3S_ROOT_VERSION=0.11.0 +K3S_TRAEFIK_VERSION=19.0.4 +K3S_TRAEFIK_PACKAGE_VERSION=00 +K3S_CNIPLUGINS_VERSION=1.1.1 +CONFIG_CHECK="~BRIDGE_NETFILTER ~CFS_BANDWIDTH ~CGROUP_DEVICE ~CGROUP_PERF ~CGROUP_PIDS ~IP_VS ~MEMCG ~NETFILTER_XT_MATCH_COMMENT ~OVERLAY_FS ~VLAN_8021Q ~VXLAN" + +MY_PV=${PV%_p*}+k3s${PV#*_p} +SRC_URI="https://github.com/zmedico/k3s/archive/refs/tags/v${MY_PV}-vendor.tar.gz -> ${P}-vendor.tar.gz + ${EGO_SUM_SRC_URI} + https://github.com/k3s-io/containerd/archive/refs/tags/v${K3S_CONTAINERD_VERSION}.tar.gz -> k3s-containerd-${K3S_CONTAINERD_VERSION}.tar.gz + https://github.com/opencontainers/runc/archive/refs/tags/${K3S_RUNC_VERSION}.tar.gz -> k3s-runc-${K3S_RUNC_VERSION}.tar.gz + https://traefik.github.io/charts/traefik/traefik-${K3S_TRAEFIK_VERSION}.tgz + https://github.com/rancher/plugins/archive/refs/tags/v${K3S_CNIPLUGINS_VERSION}-k3s1.tar.gz -> k3s-cni-plugins-${K3S_CNIPLUGINS_VERSION}.tar.gz + amd64? ( https://github.com/rancher/k3s-root/releases/download/v${K3S_ROOT_VERSION}/k3s-root-amd64.tar -> k3s-root-amd64-${K3S_ROOT_VERSION}.tar )" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64" +IUSE="+kubectl-symlink rootless" +REQUIRED_USE="|| ( amd64 )" +DEPEND=" + app-misc/yq + net-firewall/conntrack-tools + sys-fs/btrfs-progs + rootless? ( app-containers/slirp4netns ) +" +RDEPEND="kubectl-symlink? ( !sys-cluster/kubectl )" +RESTRICT+=" test" + +S=${WORKDIR}/${PN}-${MY_PV/+/-}-vendor + +src_unpack() { + unpack ${P}-vendor.tar.gz + cd "${S}" || die + mkdir -p bin/aux build/static/charts cache etc || die + cp "${DISTDIR}/traefik-${K3S_TRAEFIK_VERSION}.tgz" build/static/charts/traefik-${K3S_TRAEFIK_VERSION}${K3S_TRAEFIK_PACKAGE_VERSION}.tgz || die + cp "${DISTDIR}/k3s-cni-plugins-${K3S_CNIPLUGINS_VERSION}.tar.gz" cache/ || die +} + +src_prepare() { + local filename pattern replacement + default + + local CONTAINERD_DIR=build/src/github.com/containerd/containerd + mkdir -p "${CONTAINERD_DIR}" || die + tar -x --strip-components=1 -f "${DISTDIR}/k3s-containerd-${K3S_CONTAINERD_VERSION}.tar.gz" -C "${CONTAINERD_DIR}" || die + if has_version -b ">=dev-lang/go-1.18"; then + # https://bugs.gentoo.org/835601 + sed -i -e "/github.com\/containerd\/containerd => .\/.empty-mod/d" "${CONTAINERD_DIR}"/{go.mod,vendor/modules.txt} || die + fi + + local RUNC_DIR=build/src/github.com/opencontainers/runc + mkdir -p "${RUNC_DIR}" || die + tar -x --strip-components=1 -f "${DISTDIR}/k3s-runc-${K3S_RUNC_VERSION}.tar.gz" -C "${RUNC_DIR}" || die + + # Disable download for files fetched via SRC_URI. + sed -e 's:^[[:space:]]*curl:#\0:' \ + -e 's:^[[:space:]]*git:#\0:' \ + -e 's:^rm -rf \${CHARTS_DIR}:#\0:' \ + -e 's:^rm -rf \${RUNC_DIR}:#\0:' \ + -e 's:^rm -rf \${CONTAINERD_DIR}:#\0:' \ + -e 's:yq e :yq -r :' \ + -e "s:^setup_tmp\$:TMP_DIR=${S}/build/static/charts:" \ + -i scripts/download || die + sed -e '/scripts\/build-upload/d' -i scripts/package-cli || die + pattern='git clone -b $VERSION_CNIPLUGINS https://github.com/rancher/plugins.git $WORKDIR' + filename=scripts/build + grep -qF "${pattern}" "${filename}" || \ + die "failed to locate plugins clone command" + sed -e "s|${pattern}|mkdir -p \"\$WORKDIR\" \\&\\& tar -xzf \"${S}/cache/k3s-cni-plugins-${K3S_CNIPLUGINS_VERSION}.tar.gz\" --strip-components=1 -C \"\$WORKDIR\"|" \ + -e 's|rm -rf $TMPDIR||' \ + -i "${filename}" || die + sed -e 's:/usr/local/bin:/usr/bin:g' -i k3s.service || die +} + +src_compile() { + mkdir -p build/data || die + "${BASH}" -ex ./scripts/download || die + ./scripts/build || die + ./scripts/package-cli || die +} + +src_install() { + dobin "dist/artifacts/${PN}" + use kubectl-symlink && dosym k3s /usr/bin/kubectl + systemd_dounit "${FILESDIR}/${PN}.service" + newinitd "${FILESDIR}/${PN}.initd" "${PN}" + newconfd "${FILESDIR}/${PN}.confd" "${PN}" + insinto /etc/logrotate.d + newins "${FILESDIR}/${PN}.logrotated" "${PN}" + dodoc README.md +} |