CentOS7: k3s

時代はk8sですと思ったら、すでに一回りしていてk3sとかあるらしいです。

k8s = Kubernetes

# curl -sfL https://get.k3s.io | sh -
[INFO] Finding latest release
[INFO] Using v0.6.1 as release
[INFO] Downloading hash https://github.com/rancher/k3s/releases/download/v0.6.1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/rancher/k3s/releases/download/v0.6.1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[INFO] SeLinux is enabled, setting permissions
[INFO] Creating /usr/local/bin/kubectl symlink to k3s
[INFO] Creating /usr/local/bin/crictl symlink to k3s
[INFO] Creating killall script /usr/local/bin/k3s-killall.sh
[INFO] Creating uninstall script /usr/local/bin/k3s-uninstall.sh
[INFO] env: Creating environment file /etc/systemd/system/k3s.service.env
[INFO] systemd: Creating service file /etc/systemd/system/k3s.service
[INFO] systemd: Enabling k3s unit
Created symlink from /etc/systemd/system/multi-user.target.wants/k3s.service to /etc/systemd/system/k3s.service.
[INFO] systemd: Starting k3s
#

消し方

# /usr/local/bin/k3s-uninstall.sh
++ id -u
+ '[' 0 = 0 ']'
+ /usr/local/bin/k3s-killall.sh
++ id -u
+ '[' 0 = 0 ']'
+ for bin in '/var/lib/rancher/k3s/data/**/bin/'
<snip>
++ basename /etc/systemd/system/k3s.service
+ systemctl stop k3s.service
+ for service in '/etc/init.d/k3s*'
+ '[' -x '/etc/init.d/k3s*' ']'
++ lsof
++ sed -e 's/^[^0-9]*//g; s/ */\t/g'
++ grep -w 'k3s/data/[^/]*/bin/containerd-shim'
++ cut -f1
++ sort -n -u
<snip>
+ '[' 13 -ne 0 ']'
++ set +x
<snip>
+ do_unmount /run/k3s
++ sort -r
++ cat /proc/self/mounts
++ awk '{print $2}'
++ grep '^/run/k3s'
<snip>
+ do_unmount /var/lib/rancher/k3s
++ cat /proc/self/mounts
++ awk '{print $2}'
++ grep '^/var/lib/rancher/k3s'
++ sort -r
<snip>
++ ip link show
++ grep 'master cni0'
++ awk '-F: ' '{print $2}'
++ sed -e 's|@.*||'
<snip>
+ rm -rf /var/lib/cni/
+ which systemctl
/usr/bin/systemctl
+ systemctl disable k3s
Removed symlink /etc/systemd/system/multi-user.target.wants/k3s.service.
+ systemctl reset-failed k3s
+ systemctl daemon-reload
+ which rc-update
which: no rc-update in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin)
+ rm -f /etc/systemd/system/k3s.service
+ rm -f /etc/systemd/system/k3s.service.env
+ trap remove_uninstall EXIT
+ '[' -L /usr/local/bin/kubectl ']'
+ rm -f /usr/local/bin/kubectl
+ '[' -L /usr/local/bin/crictl ']'
+ rm -f /usr/local/bin/crictl
+ rm -rf /etc/rancher/k3s
+ rm -rf /var/lib/rancher/k3s
+ rm -f /usr/local/bin/k3s
+ rm -f /usr/local/bin/k3s-killall.sh
+ remove_uninstall
+ rm -f /usr/local/bin/k3s-uninstall.sh

綺麗に消してくれる。

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です