This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
forked from poblin-orange/k3s-boshrelease
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from poblin-orange/develop
k3s-1.19
- Loading branch information
Showing
36 changed files
with
561 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
builds: | ||
41fe074fc5fe879b1909bdc82b3050c42b94e2d4aa945de2ce4e5f5737feb8dc: | ||
version: 41fe074fc5fe879b1909bdc82b3050c42b94e2d4aa945de2ce4e5f5737feb8dc | ||
blobstore_id: 7c6d7770-354c-44b0-6150-82614409dfb2 | ||
sha1: sha256:79ec01ab7c166b7121052ee44ce0109bb0318bb8e14e5e23c7b1d9dc5f619910 | ||
format-version: "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
#!/bin/bash | ||
wget https://github.com/rancher/k3s/releases/download/v1.17.2-alpha3%2Bk3s1/k3s -O src/k3s | ||
wget https://github.com/rancher/k3s/releases/download/v1.19.3%2Bk3s1/k3s -O src/k3s | ||
bosh add-blob src/k3s k3s/k3s | ||
|
||
wget https://github.com/rancher/k3s/releases/download/v1.17.2-alpha3%2Bk3s1/k3s-airgap-images-amd64.tar -O src/k3s-airgap-images-amd64.tar | ||
wget https://github.com/rancher/k3s/releases/download/v1.19.3%2Bk3s1/k3s-airgap-images-amd64.tar -O src/k3s-airgap-images-amd64.tar | ||
bosh add-blob src/k3s-airgap-images-amd64.tar k3s-images/k3s-airgap-images-amd64.tar | ||
|
||
wget https://github.com/derailed/k9s/releases/download/v0.13.6/k9s_0.13.6_Linux_x86_64.tar.gz -O src/k9s_0.13.6_Linux_x86_64.tar.gz | ||
wget https://github.com/derailed/k9s/releases/download/v0.22.1/k9s_Linux_x86_64.tar.gz -O src/k9s_Linux_x86_64.tar.gz | ||
cd src | ||
tar xfv k9s_0.13.6_Linux_x86_64.tar.gz | ||
tar xfv ./k9s_Linux_x86_64.tar.gz | ||
cd .. | ||
bosh add-blob src/k9s k9s/k9s | ||
# rm src/k9s_0.13.6_Linux_x86_64.tar.gz | ||
|
||
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/linux/amd64/kubectl -O src/kubectl | ||
|
||
bosh add-blob src/kubectl kubectl/kubectl | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
k3s-images/k3s-airgap-images-amd64.tar: | ||
size: 349377024 | ||
sha: sha256:e1d140575deb3043cb0102d1ae510ab3273875a275662e1ca84a89c955471189 | ||
size: 369606656 | ||
object_id: 172301a2-56a0-4496-7b48-aa79d399a3e8 | ||
sha: sha256:9d3013742f011bd08225344ae5fd85407bd2bcd88886261ba58e1bff5b00f08d | ||
k3s/k3s: | ||
size: 52273152 | ||
sha: sha256:b283533e78a2bdec3b6b20b92729b3618221e1e89321dbce73ac1fb466ea4f1a | ||
size: 53424128 | ||
object_id: d928a091-fd50-41a4-5b18-d61bfa41fe92 | ||
sha: sha256:3b031d78f9edeed6718b5cd1070e4bd46524faa90a82d64f6f28008f6192c5dc | ||
k9s/k9s: | ||
size: 42287104 | ||
sha: sha256:241b52c6373d46bb4fc076c5f656618fd0cbb728823030880e0d89d840278050 | ||
size: 49139712 | ||
object_id: ce7272d4-d76c-4d67-68a2-4ccd59366344 | ||
sha: sha256:04b457ba48879f64ec97ca513ad573328939b2c9b3591cb1171d7bd989e3eaef | ||
kubectl/kubectl: | ||
size: 43003904 | ||
object_id: bb931f61-9bd1-4cca-71a0-bf1139913a72 | ||
sha: sha256:79bb0d2f05487ff533999a639c075043c70a0a1ba25c1629eb1eef6ebe3ba70f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
#FIXME: check how a node can drain itself (which kubeconfig ?) | ||
exit 0 | ||
|
||
LOG_DIR=/var/vcap/sys/log/k3s-agent | ||
|
||
/var/vcap/packages/kubectl-k3s/kubectl --kubeconfig=/var/vcap/store/k3s-agent/kubeconfig.yml get pods --all-namespaces | ||
|
||
#drain | ||
/var/vcap/packages/kubectl-k3s/kubectl --kubeconfig=/var/vcap/store/k3s-agent/kubeconfig.yml drain <%= spec.ip %> \ | ||
--delete-local-data=<%= p('k3s.drain.delete-local-data') %> \ | ||
--disable-eviction=<%= p('k3s.drain.disable-eviction') %> \ | ||
--grace-period=<%= p('k3s.drain.grace-period') %> \ | ||
--ignore-daemonsets=<%= p('k3s.drain.ignore-daemonsets') %> \ | ||
--skip-wait-for-delete-timeout=<%= p('k3s.drain.skip-wait-for-delete-timeout') %> \ | ||
--timeout=<%= p('k3s.drain.timeout') %> \ | ||
>> $JOB_DIR/drain.log \ | ||
2>> $JOB_DIR/drain-stderr.log | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#!/bin/sh | ||
[ $(id -u) -eq 0 ] || exec sudo $0 $@ | ||
|
||
for bin in /var/lib/rancher/k3s/data/**/bin/; do | ||
[ -d $bin ] && export PATH=$bin:$PATH | ||
done | ||
|
||
set -x | ||
|
||
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 | ||
|
||
pschildren() { | ||
ps -e -o ppid= -o pid= | \ | ||
sed -e 's/^\s*//g; s/\s\s*/\t/g;' | \ | ||
grep -w "^$1" | \ | ||
cut -f2 | ||
} | ||
|
||
pstree() { | ||
for pid in $@; do | ||
echo $pid | ||
for child in $(pschildren $pid); do | ||
pstree $child | ||
done | ||
done | ||
} | ||
|
||
killtree() { | ||
kill -9 $( | ||
{ set +x; } 2>/dev/null; | ||
pstree $@; | ||
set -x; | ||
) 2>/dev/null | ||
} | ||
|
||
getshims() { | ||
lsof | sed -e 's/^[^0-9]*//g; s/ */\t/g' | grep -w 'k3s/data/[^/]*/bin/containerd-shim' | cut -f1 | sort -n -u | ||
} | ||
|
||
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 '/run/k3s' | ||
do_unmount '/var/lib/rancher/k3s' | ||
do_unmount '/var/lib/kubelet/pods' | ||
do_unmount '/run/netns/cni-' | ||
|
||
# Delete network interface(s) that match 'master cni0' | ||
ip link show 2>/dev/null | grep 'master cni0' | while read ignore iface ignore; do | ||
iface=${iface%%@*} | ||
[ -z "$iface" ] || ip link delete $iface | ||
done | ||
ip link delete cni0 | ||
ip link delete flannel.1 | ||
rm -rf /var/lib/cni/ | ||
iptables-save | grep -v KUBE- | grep -v CNI- | iptables-restore | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "post-stop: k3s-killall.sh to clean the host" | ||
/var/vcap/jobs/k3s-agent/bin/k3s-killall.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
#!/bin/sh | ||
/var/vcap/packages/k3s/k3s check-config | ||
|
||
#bpm pre start recommandation | ||
sysctl -e -w net.ipv4.tcp_fin_timeout 10 | ||
sysctl -e -w net.ipv4.tcp_tw_reuse 1 | ||
#prepare a persistent directory so /etc/rancher/node paswword file is kept on bosh recreate | ||
mkdir -p /etc/rancher | ||
mkdir -p /var/vcap/store/k3s-agent/etc/rancher/node | ||
ln -sf /var/vcap/store/k3s-agent/etc/rancher/node /etc/rancher/node | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
--- | ||
|
||
<% if_p('registry.mirrors.endpoint') do |value| %> | ||
|
||
|
||
mirrors: | ||
docker.io: | ||
endpoint: | ||
- <%= p('registry.mirrors.endpoint') %> | ||
configs: | ||
customreg: | ||
<% if_p('registry.mirrors.auth.username') do |auth| %> | ||
auth: | ||
username: <%= p('registry.mirrors.auth.username') %> # this is the registry username | ||
password: <%= p('registry.mirrors.auth.password') %> # this is the registry password | ||
<% end %> | ||
<% if_p('registry.mirrors.tls.cert') do |value| %> | ||
tls: | ||
cert_file: /var/vcap/jobs/k3s-server/config/registry.cert | ||
key_file: /var/vcap/jobs/k3s-server/config/registry.key | ||
ca_file: /var/vcap/jobs/k3s-server/config/registry.ca | ||
<% end %> | ||
<% end %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% if_p('registry.mirrors.tls.cert') do |value| %> | ||
<%= p('registry.mirrors.tls.ca') %> | ||
<<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% if_p('registry.mirrors.tls.cert') do |value| %> | ||
<%= p('registry.mirrors.tls.cert') %> | ||
<<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<% if_p('registry.mirrors.tls.cert') do |value| %> | ||
<%= p('registry.mirrors.tls.key') %> | ||
<<% end %> |
Oops, something went wrong.