sys-cluster/k3s: Fixes r1

This commit is contained in:
Stefan Reimer 2019-09-24 21:47:32 +01:00
parent 8db0cce13d
commit ec7e235bad
3 changed files with 69 additions and 5 deletions

View File

@ -1,5 +1,6 @@
AUX k3s.conf 195 BLAKE2B 5abbfc47597f37d41c741c9c06eb2eb465f03dcd418368f7e695368d831691dee94405c940b09e089b2874897f1508b3b333d05c21c0e2de0ff8f8f961497d12 SHA512 491331db354cd7db91107fa1503419b29baa14fcf726b3754a67b9aba0d2ae939f2e174cb48b581946a80b75d5d4dbac79b7f421b5a225b481be7884d53e26e7 AUX k3s.conf 195 BLAKE2B 5abbfc47597f37d41c741c9c06eb2eb465f03dcd418368f7e695368d831691dee94405c940b09e089b2874897f1508b3b333d05c21c0e2de0ff8f8f961497d12 SHA512 491331db354cd7db91107fa1503419b29baa14fcf726b3754a67b9aba0d2ae939f2e174cb48b581946a80b75d5d4dbac79b7f421b5a225b481be7884d53e26e7
AUX k3s.openrc 722 BLAKE2B 1fc39868fccd9163d73e3227700c9d349d71141e78f115e85437b344af8054a868076cee8987232a8fb65287701e425bea75f6b5f38f878a8e334cd83fc92c8a SHA512 1a2400c0d9a72e7d8a428f485ffafb1dfb7c1a78e068b184bf931c86fb3e09fe6e6c33ee4714132f7f0fc0353ba3a0c35125d6c69469353ec0fc5e5a9e85736c AUX k3s.openrc 722 BLAKE2B 1fc39868fccd9163d73e3227700c9d349d71141e78f115e85437b344af8054a868076cee8987232a8fb65287701e425bea75f6b5f38f878a8e334cd83fc92c8a SHA512 1a2400c0d9a72e7d8a428f485ffafb1dfb7c1a78e068b184bf931c86fb3e09fe6e6c33ee4714132f7f0fc0353ba3a0c35125d6c69469353ec0fc5e5a9e85736c
AUX killall_k3s.sh 1104 BLAKE2B 94201c573ccad9ae3ed60a07aa28b653bec48f317f4e23c12c71c14f28c5a15ea01f0c6afbbd4e0dd231f6848d1f1bf4b7eb30cb3ba5db2c5af63df6706ea72c SHA512 bb6b7a1fb312035d1416e51dbddd1f32cb965cea9998700134e2f5d90d86413c628156231ecc6b8ef1d6bd441961db800e5d4957866416f28d307a97a602bd6b
DIST github.com-Microsoft-go-winio-v0.4.12.tar.gz 92439 BLAKE2B 7ce1539125742ab5d96586a8cbaddef90f1aeba8124430ee33c23374a3dc1a117fe8bd6d68591c83f0a8e4fb1633c74a19fcc8466567f89450056ea3843dca21 SHA512 3dfeb9f884aff5bb1b667a6558471274161ca7b4cd9402e47250903b74522f0bd6dec13ce32c8312eb8570f94dc061a5bf9ada5e0837d45a510cd4abf38c8211 DIST github.com-Microsoft-go-winio-v0.4.12.tar.gz 92439 BLAKE2B 7ce1539125742ab5d96586a8cbaddef90f1aeba8124430ee33c23374a3dc1a117fe8bd6d68591c83f0a8e4fb1633c74a19fcc8466567f89450056ea3843dca21 SHA512 3dfeb9f884aff5bb1b667a6558471274161ca7b4cd9402e47250903b74522f0bd6dec13ce32c8312eb8570f94dc061a5bf9ada5e0837d45a510cd4abf38c8211
DIST github.com-alexflint-go-filemutex-72bdc8eae2ae.tar.gz 3110 BLAKE2B 71924138332ea7609025d0f031212404131595bb79a11eb9e3a400ebcb1a3828a04d78fb20846d0af4d805986add9db0660c1503658bdb6035c39521d557d480 SHA512 ee78d132ecb8daa6502c532bff900b94909f59daac656fad1a39c4a7a524ef2eafde8378d54ce079ed6c58d71e70c5f591a11888492ed23fccf3949b4813fde9 DIST github.com-alexflint-go-filemutex-72bdc8eae2ae.tar.gz 3110 BLAKE2B 71924138332ea7609025d0f031212404131595bb79a11eb9e3a400ebcb1a3828a04d78fb20846d0af4d805986add9db0660c1503658bdb6035c39521d557d480 SHA512 ee78d132ecb8daa6502c532bff900b94909f59daac656fad1a39c4a7a524ef2eafde8378d54ce079ed6c58d71e70c5f591a11888492ed23fccf3949b4813fde9
DIST github.com-bhendo-go-powershell-219e7fb4e41e.tar.gz 5756 BLAKE2B b21030e20736251d73814c2a3e2aba192da4265c56f04ad44c2606f0fa82d34d049e402ac12ea0aea1a0f0607bfad0af29d2d654a0d38b1f90c9c942dfa6217b SHA512 229b262506e8ec1dae9c3af48a641ed3417976611a582a056313c31fb7719edadcebcc14fa8b04585515030108c9bb76a43d161f834ae1d774b47d44edf2f8b4 DIST github.com-bhendo-go-powershell-219e7fb4e41e.tar.gz 5756 BLAKE2B b21030e20736251d73814c2a3e2aba192da4265c56f04ad44c2606f0fa82d34d049e402ac12ea0aea1a0f0607bfad0af29d2d654a0d38b1f90c9c942dfa6217b SHA512 229b262506e8ec1dae9c3af48a641ed3417976611a582a056313c31fb7719edadcebcc14fa8b04585515030108c9bb76a43d161f834ae1d774b47d44edf2f8b4
@ -43,4 +44,4 @@ DIST github.com-xeipuuv-gojsonpointer-4e3ac2762d5f.tar.gz 7718 BLAKE2B 94b4c2ac9
DIST github.com-xeipuuv-gojsonreference-bd5ef7bd5415.tar.gz 6952 BLAKE2B 5390e11eaae7b3ef816f044874e665ce76cdf84cfdd19139a0923921f56e8cc24fc418952a0d1ec1ef56aa535fe314c131073ff0ae248f1c4b918bd70485d073 SHA512 e14f931af21c64ad4fd68e3f226d062938e747fc0107b00c41ffac489193b39874ed1ebe6dc24478f6979f9055ae4ca67c016c11952589c8a95ca3f3fc69c1ea DIST github.com-xeipuuv-gojsonreference-bd5ef7bd5415.tar.gz 6952 BLAKE2B 5390e11eaae7b3ef816f044874e665ce76cdf84cfdd19139a0923921f56e8cc24fc418952a0d1ec1ef56aa535fe314c131073ff0ae248f1c4b918bd70485d073 SHA512 e14f931af21c64ad4fd68e3f226d062938e747fc0107b00c41ffac489193b39874ed1ebe6dc24478f6979f9055ae4ca67c016c11952589c8a95ca3f3fc69c1ea
DIST github.com-xeipuuv-gojsonschema-1d523034197f.tar.gz 64953 BLAKE2B 4b9b3ceeb9bf6b7eeb040b5921101a9fbec82f282cb44e2a76b7b2c0b8666ddfc82d7afd83e3ec766b076fc30e43ddf05c0314393caf571e58fd61c728b843fd SHA512 422e777b208b300abf18ac4732a3f7fb4b72087fb2c8c6832d57bc9794206f266e896c5eba7ea5040639e3cdd7d85fd982e86d0661a534d33e37811651dfbea8 DIST github.com-xeipuuv-gojsonschema-1d523034197f.tar.gz 64953 BLAKE2B 4b9b3ceeb9bf6b7eeb040b5921101a9fbec82f282cb44e2a76b7b2c0b8666ddfc82d7afd83e3ec766b076fc30e43ddf05c0314393caf571e58fd61c728b843fd SHA512 422e777b208b300abf18ac4732a3f7fb4b72087fb2c8c6832d57bc9794206f266e896c5eba7ea5040639e3cdd7d85fd982e86d0661a534d33e37811651dfbea8
DIST k3s-0.9.0.tar.gz 17410789 BLAKE2B d178f556c3d0c18929fa2d7d1bf3e2ea9665e263e5a764b148191c09647640f683ba1f853f99511885ff67fce0e1a0d41f3f40047022763dfe49acee5c1a16cf SHA512 3a0a75989b8ccdb0d0d41eb82ec232f9a32749fef1e519d3a6be19b43d91f4fb166b64f4a5cb61b2b759f692d82d8ea47400c771ca14c8111fcc1a0bec447f65 DIST k3s-0.9.0.tar.gz 17410789 BLAKE2B d178f556c3d0c18929fa2d7d1bf3e2ea9665e263e5a764b148191c09647640f683ba1f853f99511885ff67fce0e1a0d41f3f40047022763dfe49acee5c1a16cf SHA512 3a0a75989b8ccdb0d0d41eb82ec232f9a32749fef1e519d3a6be19b43d91f4fb166b64f4a5cb61b2b759f692d82d8ea47400c771ca14c8111fcc1a0bec447f65
EBUILD k3s-0.9.0.ebuild 4103 BLAKE2B d67216947c188661aa43104299bb215c8b38f329df44a3d8679f36047fea221f952a29b321c47f3e0c336ff949d4fc1d20705f30cdbc1327cca466e0d9f69983 SHA512 bacd8bbdd770753dbf2d5d9cb63c484f8200db17c1223ead7936e8e057b47f82af49929d0bca833075f6851d867e19f8e7bb9d01233c00385987b01188fe7e2e EBUILD k3s-0.9.0-r1.ebuild 4356 BLAKE2B 9e360517319a2e1b689fe954724bd6fa2f0891005a0c8fd9d3b8be0b2a0172a3aa9b991ac82763723766283d0830126e9b8128d832939315745586f91d14b7f5 SHA512 35c64860919d67e3f006ffd73c061ad90c47f472460b757fe50df4f8e9da267041d524aa76b3ebe36e1272850c8ab3e0b6ffcc73756ae7c6286a2d9c7563273c

View File

@ -0,0 +1,50 @@
#!/bin/sh
set -x
[ $(id -u) -eq 0 ] || exec sudo $0 $@
for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$bin:$PATH
done
for service in /etc/systemd/system/k3s*.service; do
[ -s $service ] && systemctl stop $(basename $service)
done
for service in /etc/init.d/k3s*; do
[ -x $service ] && $service stop
done
pstree() {
for pid in $@; do
echo $pid
pstree $(ps -o ppid= -o pid= | awk "\$1==$pid {print \$2}")
done
}
killtree() {
[ $# -ne 0 ] && kill $(set +x; pstree $@; set -x)
}
killtree $(lsof | sed -e 's/^[^0-9]*//g; s/ */\t/g' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1 | sort -n -u)
do_unmount() {
MOUNTS=$(cat /proc/self/mounts | awk '{print $2}' | grep "^$1" | sort -r)
if [ -n "${MOUNTS}" ]; then
umount ${MOUNTS}
fi
}
do_unmount '/run/k3s'
do_unmount '/var/lib/rancher/k3s'
nets=$(ip link show | grep 'master cni0' | awk -F': ' '{print $2}' | sed -e 's|@.*||')
for iface in $nets; do
ip link delete $iface;
done
ip link delete cni0
ip link delete flannel.1
rm -rf /var/lib/cni/

View File

@ -54,7 +54,7 @@ inherit eutils golang-build golang-vcs-snapshot
ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz" ARCHIVE_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
KEYWORDS="~amd64" KEYWORDS="~amd64"
IUSE="+rootless +traefik" IUSE="rootless symlink"
DESCRIPTION="Lightweight Kubernetes. 5 less than k8s." DESCRIPTION="Lightweight Kubernetes. 5 less than k8s."
HOMEPAGE="https://k3s.io" HOMEPAGE="https://k3s.io"
@ -92,8 +92,6 @@ EOF
# Disable go generate, create codegen only # Disable go generate, create codegen only
sed -i -e 's|go generate|go run pkg/codegen/main.go|' scripts/package-cli sed -i -e 's|go generate|go run pkg/codegen/main.go|' scripts/package-cli
use traefik || rm -f manifests/traefik.yaml
} }
@ -121,7 +119,15 @@ src_install() {
newinitd "${FILESDIR}/k3s.openrc" k3s newinitd "${FILESDIR}/k3s.openrc" k3s
newconfd "${FILESDIR}/k3s.conf" k3s newconfd "${FILESDIR}/k3s.conf" k3s
keepdir /var/lib/rancher into /var/lib/rancher/${PN}
newbin "${FILESDIR}/killall_k3s.sh" killall_k3s.sh
if use symlink; then
for cmd in kubectl crictl ctr; do
einfo "Linking ${cmd} to k3s"
dosym k3s /usr/bin/${cmd}
done
fi
} }
pkg_preinst() { pkg_preinst() {
@ -140,3 +146,10 @@ pkg_postinst() {
elog "usermod --add-subgids 1065536-1131071 <user>" elog "usermod --add-subgids 1065536-1131071 <user>"
fi fi
} }
pkg_setup() {
if use rootless; then
enewgroup ${PN}
enewuser ${PN} -1 -1 /var/lib/rancher/${PN} ${PN}
fi
}