Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #63 from poblin-orange/develop
Browse files Browse the repository at this point in the history
version 24
  • Loading branch information
poblin-orange authored Jan 28, 2022
2 parents ac652b6 + 8dcb8e9 commit c556a68
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 40 deletions.
4 changes: 4 additions & 0 deletions .final_builds/jobs/k3s-agent/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ builds:
version: 5b14ed5543b5f02d5fbdfe8faf912cfe95a1ba153e9dae305a05126b5629a6bc
blobstore_id: a6569d34-c9fc-4dfe-7bca-e4d543fed4ca
sha1: sha256:78b3ce29792f0a098e8e9479d7eb7681e237ed0dd64feb9734a11e5a8b4893f3
70212d297f06c6e9689878d0e94a1ac2d02fc891d04e1a24fcd97d6e1f27e816:
version: 70212d297f06c6e9689878d0e94a1ac2d02fc891d04e1a24fcd97d6e1f27e816
blobstore_id: 8444c141-64e5-46cb-7bdb-59cd7a6b2a58
sha1: sha256:89370e98c20d1289c39f57681125bbe717da4040b017ccdb46d18e4dbc51dcf7
7079178f9125351d8c140ae67cbc739346fe428747416c548eaf204e08cb057a:
version: 7079178f9125351d8c140ae67cbc739346fe428747416c548eaf204e08cb057a
blobstore_id: 8c32507e-bf58-43b5-73bb-1744ef0af7ae
Expand Down
4 changes: 4 additions & 0 deletions .final_builds/jobs/k3s-server/index.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
builds:
0e2deda2433a51cf68a0e19d14f5f0521d0e2805f29e978cec59538b194a2365:
version: 0e2deda2433a51cf68a0e19d14f5f0521d0e2805f29e978cec59538b194a2365
blobstore_id: f69713b9-a328-46b0-533d-d93036e7ff74
sha1: sha256:2a881762069f869bdb1e8a530b64bac6554a248e3326bf6b3cc2c5f25202a089
12c493dca43ef98384446c9cd58a2e27ccc5a4ec9460e26e79e26650fc28b117:
version: 12c493dca43ef98384446c9cd58a2e27ccc5a4ec9460e26e79e26650fc28b117
blobstore_id: ace293df-dfcc-47bd-62f7-d57aa73903fd
Expand Down
38 changes: 18 additions & 20 deletions jobs/k3s-agent/templates/bin/k3s-killall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[ $(id -u) -eq 0 ] || exec sudo $0 $@

for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$bin:$PATH
[ -d $bin ] && export PATH=$PATH:$bin:$bin/aux
done

set -x
Expand Down Expand Up @@ -45,26 +45,23 @@ getshims() {

killtree $({ set +x; } 2>/dev/null; getshims; set -x)

do_unmount() {
{ set +x; } 2>/dev/null
MOUNTS=
while read ignore mount ignore; do
MOUNTS="$mount\n$MOUNTS"
done </proc/self/mounts
MOUNTS=$(printf $MOUNTS | grep "^$1" | sort -r)
if [ -n "${MOUNTS}" ]; then
set -x
umount ${MOUNTS}
else
set -x
fi
do_unmount_and_remove() {
set +x
while read -r _ path _; do
case "$path" in $1*) echo "$path" ;; esac
done < /proc/self/mounts | sort -r | xargs -r -t -n 1 sh -c 'umount "$0" && rm -rf "$0"'
set -x
}

do_unmount '/run/k3s'
do_unmount '/var/lib/rancher/k3s'
do_unmount '/var/vcap/data/k3s-agent/kubelet/pods' #bosh fs layout adaptation
do_unmount '/var/vcap/data/k3s-agent/kubelet/plugins/kubernetes.io/csi' #bosh fs adaptation for csi mount (eg: longhorn)
do_unmount '/run/netns/cni-'
do_unmount_and_remove '/run/k3s'
do_unmount_and_remove '/var/lib/rancher/k3s'
do_unmount_and_remove '/var/vcap/data/k3s-agent/kubelet/pods' #bosh fs layout adaptation
do_unmount_and_remove '/var/vcap/data/k3s-agent/kubelet/plugins'
do_unmount_and_remove '/var/vcap/data/k3s-agent/kubelet/plugins/kubernetes.io/csi' #bosh fs adaptation for csi mount (eg: longhorn)
do_unmount_and_remove '/run/netns/cni-'

# Remove CNI namespaces
ip netns show 2>/dev/null | grep cni- | xargs -r -t -n 1 ip netns delete

# Delete network interface(s) that match 'master cni0'
ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; do
Expand All @@ -73,6 +70,7 @@ ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore;
done
ip link delete cni0
ip link delete flannel.1
ip link delete flannel-v6.1
rm -rf /var/lib/cni/
iptables-save | grep -v KUBE- | grep -v CNI- | iptables-restore

ip6tables-save | grep -v KUBE- | grep -v CNI- | ip6tables-restore
37 changes: 17 additions & 20 deletions jobs/k3s-server/templates/bin/k3s-killall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[ $(id -u) -eq 0 ] || exec sudo $0 $@

for bin in /var/lib/rancher/k3s/data/**/bin/; do
[ -d $bin ] && export PATH=$bin:$PATH
[ -d $bin ] && export PATH=$PATH:$bin:$bin/aux
done

set -x
Expand Down Expand Up @@ -45,27 +45,23 @@ getshims() {

killtree $({ set +x; } 2>/dev/null; getshims; set -x)

do_unmount() {
{ set +x; } 2>/dev/null
MOUNTS=
while read ignore mount ignore; do
MOUNTS="$mount\n$MOUNTS"
done </proc/self/mounts
MOUNTS=$(printf $MOUNTS | grep "^$1" | sort -r)
if [ -n "${MOUNTS}" ]; then
set -x
umount ${MOUNTS}
else
set -x
fi
do_unmount_and_remove() {
set +x
while read -r _ path _; do
case "$path" in $1*) echo "$path" ;; esac
done < /proc/self/mounts | sort -r | xargs -r -t -n 1 sh -c 'umount "$0" && rm -rf "$0"'
set -x
}

do_unmount '/run/k3s'
do_unmount '/var/lib/rancher/k3s'
do_unmount '/var/vcap/data/k3s-agent/kubelet/pods' #bosh fs layout adaptation
do_unmount '/var/vcap/data/k3s-agent/kubelet/plugins/kubernetes.io/csi' #bosh fs adaptation for csi mount (eg: longhorn)
do_unmount_and_remove '/run/k3s'
do_unmount_and_remove '/var/lib/rancher/k3s'
do_unmount_and_remove '/var/vcap/data/k3s-server/kubelet/pods' #bosh fs layout adaptation
do_unmount_and_remove '/var/vcap/data/k3s-server/kubelet/plugins'
do_unmount_and_remove '/var/vcap/data/k3s-server/kubelet/plugins/kubernetes.io/csi' #bosh fs adaptation for csi mount (eg: longhorn)
do_unmount_and_remove '/run/netns/cni-'

do_unmount '/run/netns/cni-'
# Remove CNI namespaces
ip netns show 2>/dev/null | grep cni- | xargs -r -t -n 1 ip netns delete

# Delete network interface(s) that match 'master cni0'
ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; do
Expand All @@ -74,6 +70,7 @@ ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore;
done
ip link delete cni0
ip link delete flannel.1
ip link delete flannel-v6.1
rm -rf /var/lib/cni/
iptables-save | grep -v KUBE- | grep -v CNI- | iptables-restore

ip6tables-save | grep -v KUBE- | grep -v CNI- | ip6tables-restore
2 changes: 2 additions & 0 deletions releases/k3s/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ builds:
version: "18"
4bd13971-4d5f-45ef-71cd-8b9f587f8fa1:
version: "10"
4d82d8ad-574d-41b1-5cd4-aece1bd4703b:
version: "24"
4e64a643-4d01-48fa-794b-6564cef26f31:
version: "1"
55effe8b-caae-4c32-5914-b7e119e74b9f:
Expand Down
58 changes: 58 additions & 0 deletions releases/k3s/k3s-24.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: k3s
version: "24"
commit_hash: dd4590a
uncommitted_changes: false
jobs:
- name: k3s-agent
version: 70212d297f06c6e9689878d0e94a1ac2d02fc891d04e1a24fcd97d6e1f27e816
fingerprint: 70212d297f06c6e9689878d0e94a1ac2d02fc891d04e1a24fcd97d6e1f27e816
sha1: sha256:89370e98c20d1289c39f57681125bbe717da4040b017ccdb46d18e4dbc51dcf7
packages:
- k3s
- kubectl-k3s
- k3s-images
- name: k3s-agent-airgaped-images
version: dac8160deeef67d642c67065cdb584c53ca84807717f4b7abb3e748badb97313
fingerprint: dac8160deeef67d642c67065cdb584c53ca84807717f4b7abb3e748badb97313
sha1: sha256:56989c04162b348ce691ad78d9ceaefc4b46338df95ebe87fda1e5ce0a30d429
packages:
- k3s-images
- name: k3s-server
version: 0e2deda2433a51cf68a0e19d14f5f0521d0e2805f29e978cec59538b194a2365
fingerprint: 0e2deda2433a51cf68a0e19d14f5f0521d0e2805f29e978cec59538b194a2365
sha1: sha256:2a881762069f869bdb1e8a530b64bac6554a248e3326bf6b3cc2c5f25202a089
packages:
- k3s
- k9s
- kubectl-k3s
- name: k3s-server-airgaped-images
version: 3e8cc00744f582f54235a554c9a5a1bcbc16c8848330d8b17fbe1ab270f7d2ef
fingerprint: 3e8cc00744f582f54235a554c9a5a1bcbc16c8848330d8b17fbe1ab270f7d2ef
sha1: sha256:fbae88a6d6e06d8ac29288b73a971832e77d2483978c56481844e1c7f8e77c78
packages:
- k3s-images
packages:
- name: k3s
version: ca2f1c2bf944fca181373694cfbd9d71351e41d5c067423fc7d2aadbceddfaf9
fingerprint: ca2f1c2bf944fca181373694cfbd9d71351e41d5c067423fc7d2aadbceddfaf9
sha1: sha256:b207bb222e2f6a240c766ad11ecc20defccb423d04b26a665bebcdc31799983d
dependencies: []
- name: k3s-images
version: 91bc70267c19c06ba5585485a95416eb0c17cef9f02002bb96a674cb714579cd
fingerprint: 91bc70267c19c06ba5585485a95416eb0c17cef9f02002bb96a674cb714579cd
sha1: sha256:1dd8f578c8f9ba11cae224fcf333218ef0c003f91a8b607b69d4182bfccc9666
dependencies: []
- name: k9s
version: 8751b3231c52d45ea7efa35f7209b322e7f6ba009ace3759f052f0672d872fd2
fingerprint: 8751b3231c52d45ea7efa35f7209b322e7f6ba009ace3759f052f0672d872fd2
sha1: sha256:2498425e99005b2e433c82ab9b5bb7c40ac778eea49e46c73c8f892eba6c2bbd
dependencies: []
- name: kubectl-k3s
version: d581d558a37afdc5289a59160b82c8823f18e6b8d4d06618137d4de444029d8f
fingerprint: d581d558a37afdc5289a59160b82c8823f18e6b8d4d06618137d4de444029d8f
sha1: sha256:197a23e8ff54e68313d4be27d7423c04a1989f24ab129bda387a960297745df8
dependencies: []
license:
version: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9
fingerprint: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9
sha1: sha256:cbe3175489dfaec91e9f392399fbfb68e008885feb91a3b8d493a35d2fc5a8fa

0 comments on commit c556a68

Please sign in to comment.