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 #123 from poblin-orange/develop
Browse files Browse the repository at this point in the history
disable k3s-kill-all.sh on bosh stop
  • Loading branch information
poblin-orange authored May 12, 2023
2 parents 2ada86e + cb90f21 commit 86049dc
Show file tree
Hide file tree
Showing 14 changed files with 122 additions and 21 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 @@ -31,6 +31,10 @@ builds:
version: 46b8ed4cc1b2a97fe7858f24cbfb120fe3ae3a242af22e97782eaa309b32e6ee
blobstore_id: 65837b42-b2d6-412d-505d-bcf43bd95479
sha1: sha256:3e9bf66a0643949e8fd3a5f10815e66c82f88a2db7f5b3dcb74e448df4b76097
4c48de9198e8bb5ea5e3876bf94aed3b3ffec6605cc4467b2e15601a92198da9:
version: 4c48de9198e8bb5ea5e3876bf94aed3b3ffec6605cc4467b2e15601a92198da9
blobstore_id: 50440b7e-43dc-46fb-539a-78dcfb5786f3
sha1: sha256:ca0f0184781c15221f5ccf157c2d266beb1551742d6941b41ff50b9e74830cb3
4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7:
version: 4f6d8e6a215704d7b2031495b0bb461222c60e8f9b096b6c7844fd777c07fee7
blobstore_id: 1af22e8b-2101-4eb2-7059-197dedba7f09
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
Expand Up @@ -19,6 +19,10 @@ builds:
version: 1618ffab1e9cc41d5dd8400ba9ec002804bc800ed4bec7dffdbdbc2b15ce7f3d
blobstore_id: 7971bd7b-bae3-4c95-6ccb-553f3b43196e
sha1: sha256:8de84c2ca819e6d43c79be4bca33e52d9b101bb96990429aa91bc60670de1625
180369f806d4ddee1da16cf1883724de29b51633adc27361d262eb3707279ae2:
version: 180369f806d4ddee1da16cf1883724de29b51633adc27361d262eb3707279ae2
blobstore_id: fac220eb-7504-4060-47bf-c4fe0dc228f0
sha1: sha256:f3e80c20091d93026007c1f61d707e22652d99727923a0f6b2c25fb7a6917ce2
1c42d77e460f3ca17fdec8951313d07b62c84342f503738e1f401a054bb5e8c6:
version: 1c42d77e460f3ca17fdec8951313d07b62c84342f503738e1f401a054bb5e8c6
blobstore_id: d0b95461-ce50-4c96-5af4-2ba09e2c2d65
Expand Down
4 changes: 4 additions & 0 deletions .final_builds/packages/k9s/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ builds:
version: 46007913d6b9fa47b9d8254f9b874fdd5eb980b4018c4bf8639a44e0d8d9f80c
blobstore_id: 817856d5-bc7f-41cd-447a-5b3956e00b5d
sha1: sha256:c94b40e0b83fe9d1da8bdea01e31672638bd8dd9b5a671051ccf273a01e46e0b
5950fdb3fe5cf31d54de992dd8dfdb17bc43eca03901b375c7e54ed89203966b:
version: 5950fdb3fe5cf31d54de992dd8dfdb17bc43eca03901b375c7e54ed89203966b
blobstore_id: d5cd2f8b-6509-469e-7a4c-fc67113797d1
sha1: sha256:d0ad55e5c5f85d986c15346247d9dec6f5b2712a5a81ebb8af80c9b5676c23a4
8751b3231c52d45ea7efa35f7209b322e7f6ba009ace3759f052f0672d872fd2:
version: 8751b3231c52d45ea7efa35f7209b322e7f6ba009ace3759f052f0672d872fd2
blobstore_id: 481d614c-eadc-476b-5619-a05ebdcf62d6
Expand Down
6 changes: 3 additions & 3 deletions config/blobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ k3s/k3s:
object_id: 2fe6b9a0-e7a5-45e0-5030-04b02db266f1
sha: sha256:9556a00fc3514a09934952550cb49b46559bcce703c0a7af31969559692f5160
k9s/k9s:
size: 58847232
object_id: f5018765-6d8d-4836-54d2-c1a6ad0ec78d
sha: sha256:09a7bb21255f794501946467a333b99d8fe77f1e4c8a91409f75d80723b80fee
size: 60559360
object_id: c8ac305d-cf15-48d7-4464-22e681f9a8ab
sha: sha256:da2a3716809fd22e8ce814719bab7044f1fac54e13f726fc327f6accd5f839a6
kubectl/kubectl:
size: 45752320
object_id: 1b0c277a-e7fe-4c64-617c-bfebaa284946
Expand Down
4 changes: 4 additions & 0 deletions jobs/k3s-agent/spec
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,10 @@ properties:
k3s.bosh-post-start-delay-seconds:
description: bosh post start tempo, to let the kubelet start the pods before bosh triggers another node update
default: 30
k3s.do-not-killall-on-post-stop:
description: if set, the bosh post-stop script wont leverage k3s-killall.sh script
default: true


#token-file
k3s.token-file-content:
Expand Down
14 changes: 7 additions & 7 deletions jobs/k3s-agent/templates/bin/k3s-killall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ killtree() {
}

getshims() {
lsof | sed -e 's/^[^0-9]*//g; s/ */\t/g' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1 | sort -n -u
ps -e -o pid= -o args= | sed -e 's/^ *//; s/\s\s*/\t/;' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1
}

killtree $({ set +x; } 2>/dev/null; getshims; set -x)
Expand Down Expand Up @@ -68,9 +68,9 @@ ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore;
iface=${iface%%@*}
[ -z "$iface" ] || ip link delete $iface
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
#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
7 changes: 7 additions & 0 deletions jobs/k3s-agent/templates/bin/post-stop.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash


<% if_p('k3s.do-not-killall-on-post-stop') do |value| %>
<% if p('k3s.do-not-killall-on-post-stop') %>
echo "post-stop: SKIP k3s-killall.sh"
<% else %>
echo "post-stop: k3s-killall.sh to clean the host"
/var/vcap/jobs/k3s-agent/bin/k3s-killall.sh
<% end %>
<% end %>
4 changes: 4 additions & 0 deletions jobs/k3s-server/spec
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ properties:
description: bosh post start tempo, to let the kubelet start the pods before bosh triggers another node update
default: 30

k3s.do-not-killall-on-post-stop:
description: if set, the bosh post-stop script wont leverage k3s-killall.sh script
default: true



## db options
Expand Down
14 changes: 7 additions & 7 deletions jobs/k3s-server/templates/bin/k3s-killall.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ killtree() {
}

getshims() {
lsof | sed -e 's/^[^0-9]*//g; s/ */\t/g' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1 | sort -n -u
ps -e -o pid= -o args= | sed -e 's/^ *//; s/\s\s*/\t/;' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1
}

killtree $({ set +x; } 2>/dev/null; getshims; set -x)
Expand Down Expand Up @@ -68,9 +68,9 @@ ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore;
iface=${iface%%@*}
[ -z "$iface" ] || ip link delete $iface
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
#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
9 changes: 8 additions & 1 deletion jobs/k3s-server/templates/bin/post-stop.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
#!/bin/bash


<% if_p('k3s.do-not-killall-on-post-stop') do |value| %>
<% if p('k3s.do-not-killall-on-post-stop') %>
echo "post-stop: SKIP k3s-killall.sh"
<% else %>
echo "post-stop: k3s-killall.sh to clean the host"
/var/vcap/jobs/k3s-server/bin/k3s-killall.sh
/var/vcap/jobs/k3s-agent/bin/k3s-killall.sh
<% end %>
<% end %>
2 changes: 2 additions & 0 deletions releases/k3s/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ builds:
version: "23"
944bf1bd-4bc7-476c-6947-1c9745954ed7:
version: "123.2"
9603c3fa-a67b-4736-509d-c337cd09052c:
version: "124.5"
a240d97b-b6f9-4b2b-4d27-884f7282c8ad:
version: "28"
aa13e70f-e6f6-402f-54ae-3505a9e67570:
Expand Down
65 changes: 65 additions & 0 deletions releases/k3s/k3s-124.5.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: k3s
version: "124.5"
commit_hash: b09e002
uncommitted_changes: false
jobs:
- name: k3s-agent
version: 4c48de9198e8bb5ea5e3876bf94aed3b3ffec6605cc4467b2e15601a92198da9
fingerprint: 4c48de9198e8bb5ea5e3876bf94aed3b3ffec6605cc4467b2e15601a92198da9
sha1: sha256:ca0f0184781c15221f5ccf157c2d266beb1551742d6941b41ff50b9e74830cb3
packages:
- k3s
- kubectl-k3s
- k3s-images
- nerdctl
- name: k3s-agent-airgaped-images
version: dac8160deeef67d642c67065cdb584c53ca84807717f4b7abb3e748badb97313
fingerprint: dac8160deeef67d642c67065cdb584c53ca84807717f4b7abb3e748badb97313
sha1: sha256:56989c04162b348ce691ad78d9ceaefc4b46338df95ebe87fda1e5ce0a30d429
packages:
- k3s-images
- name: k3s-server
version: 180369f806d4ddee1da16cf1883724de29b51633adc27361d262eb3707279ae2
fingerprint: 180369f806d4ddee1da16cf1883724de29b51633adc27361d262eb3707279ae2
sha1: sha256:f3e80c20091d93026007c1f61d707e22652d99727923a0f6b2c25fb7a6917ce2
packages:
- k3s
- k9s
- kubectl-k3s
- nerdctl
- name: k3s-server-airgaped-images
version: 3e8cc00744f582f54235a554c9a5a1bcbc16c8848330d8b17fbe1ab270f7d2ef
fingerprint: 3e8cc00744f582f54235a554c9a5a1bcbc16c8848330d8b17fbe1ab270f7d2ef
sha1: sha256:fbae88a6d6e06d8ac29288b73a971832e77d2483978c56481844e1c7f8e77c78
packages:
- k3s-images
packages:
- name: k3s
version: c669f9ecbc24fdd1c43ad76efe48c06462847af2b846304109217add21eaa875
fingerprint: c669f9ecbc24fdd1c43ad76efe48c06462847af2b846304109217add21eaa875
sha1: sha256:f58b052f562cf24da1c7bd2cbb90b0e84ba954b3bdcced2c709ce194ce72af8c
dependencies: []
- name: k3s-images
version: a16ce2041f67cebc88abecf01a53170ec42c573dcf85a5bdaf24fec785b7e21e
fingerprint: a16ce2041f67cebc88abecf01a53170ec42c573dcf85a5bdaf24fec785b7e21e
sha1: sha256:269ed13519fd43c1229e3e27ba74177c1a56a235a630370db3baa142dfb6caf6
dependencies: []
- name: k9s
version: 5950fdb3fe5cf31d54de992dd8dfdb17bc43eca03901b375c7e54ed89203966b
fingerprint: 5950fdb3fe5cf31d54de992dd8dfdb17bc43eca03901b375c7e54ed89203966b
sha1: sha256:d0ad55e5c5f85d986c15346247d9dec6f5b2712a5a81ebb8af80c9b5676c23a4
dependencies: []
- name: kubectl-k3s
version: 7ad3a6f1733dd6068d1f380ffff2daeaec2d7bbefdc297873854c55eec287f86
fingerprint: 7ad3a6f1733dd6068d1f380ffff2daeaec2d7bbefdc297873854c55eec287f86
sha1: sha256:0325c1d22e341d13c91abf7df05c31c3df8effa6da3c3d0bca3920e26edca721
dependencies: []
- name: nerdctl
version: 3ef7aaf0a97b5ea75f13913f2c73609b90e9fb46695d743c2acedd5d0d9e4eb4
fingerprint: 3ef7aaf0a97b5ea75f13913f2c73609b90e9fb46695d743c2acedd5d0d9e4eb4
sha1: sha256:beb08f27a3f548472c8c0edee96e813fba538d7e4b2229325e5262cc30aa7d30
dependencies: []
license:
version: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9
fingerprint: cf0ca1fe65dee9607c7bb9460a3f20835e582cbb7f5b2c3625fba2e21d7e91b9
sha1: sha256:cbe3175489dfaec91e9f392399fbfb68e008885feb91a3b8d493a35d2fc5a8fa
4 changes: 2 additions & 2 deletions vendir.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ directories:
url: https://api.github.com/repos/k3s-io/k3s/releases/100133123
path: github.com/k3s-io/k3s
- githubRelease:
tag: v0.27.3
url: https://api.github.com/repos/derailed/k9s/releases/92146754
tag: v0.27.4
url: https://api.github.com/repos/derailed/k9s/releases/102132777
path: github.com/derailed/k9s
- githubRelease:
tag: v1.3.1
Expand Down
2 changes: 1 addition & 1 deletion vendir.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ directories:
- path: github.com/derailed/k9s
githubRelease:
slug: derailed/k9s
tag: v0.27.3
tag: v0.27.4
disableAutoChecksumValidation: true
includePaths:
- "k9s_Linux_amd64.tar.gz"
Expand Down

0 comments on commit 86049dc

Please sign in to comment.