快速部署k3s
主机1上部署master节点
# 节点命名为master
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_NODE_NAME=master sh -
主机2上部署slave节点
# 节点命名为slave-1
# 假设主机1的IP为192.168.1.10
# 假设主机1的Token为xxxx::server:yyyy
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://192.168.1.10:6443 K3S_TOKEN=xxxx::server:yyyy K3S_NODE_NAME=slave-1 sh -
查看主机1的K3S_TOKEN
sudo cat /var/lib/rancher/k3s/server/node-token
标记slave-1为workder
kubectl label node slave-1 node-role.kubernetes.io/worker=true --overwrite
卸载k3s(作为服务器)
sh /usr/local/bin/k3s-uninstall.sh
卸载k3s(作为agent)
/usr/local/bin/k3s-agent-uninstall.sh
标签:slave,k3s,K3S,部署,sh,rancher,快速,cn
From: https://www.cnblogs.com/umichan0621/p/17198759.html