參考資訊:
https://docs.k3s.io/installation/uninstall
https://kubernetes.io/zh-cn/docs/tasks/run-application/run-stateless-application-deployment/
安裝K3s
$ cd $ curl -sfL https://get.k3s.io | sh -s - --write-kubeconfig-mode 644 $ sudo systemctl status k3s ● k3s.service - Lightweight Kubernetes Loaded: loaded (/etc/systemd/system/k3s.service; enabled; vendor preset: enabled) Active: active (running) since Thu 2024-05-09 21:17:43 CST; 13h ago Docs: https://k3s.io Process: 121268 ExecStartPre=/bin/sh -xc ! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service 2>/dev/null (code=exited, status=0/SUCCESS) Process: 121270 ExecStartPre=/sbin/modprobe br_netfilter (code=exited, status=0/SUCCESS) Process: 121271 ExecStartPre=/sbin/modprobe overlay (code=exited, status=0/SUCCESS) Main PID: 121272 (k3s-server) $ kubectl get node NAME STATUS ROLES AGE VERSION ubuntu Ready control-plane,master 13h v1.29.4+k3s1 $ kubectl get pod No resources found in default namespace.
移除K3s
$ /usr/local/bin/k3s-uninstall.sh $ #/usr/local/bin/k3s-agent-uninstall.sh