快速建立k3s
One possible paraphrase in Chinese could be:
– 目标 (mù
我想要一个K8s验证环境,但频繁地创建和破坏它。然而,由于这个”创建和破坏”的过程比我想象的更花时间,所以我选择使用Terraform来进行虚拟机的配置,并且使用k3s来构建K8s本身,以便快速构建。
准备VM
172.24.20.201 (master)
172.24.20.202 (worker)
172.24.20.203 (worker)
172.24.20.204 (worker)
172.24.20.205 (worker)
大师的建构
curl -sfL https://get.k3s.io | sh -
请确认主人的构建
root@terraform-vm01:/home/tmcit# k3s kubectl get nodes
NAME STATUS ROLES AGE VERSION
terraform-vm01 Ready control-plane,master 26s v1.27.3+k3s1
确认令牌
root@terraform-vm01:/home/tmcit# cat /var/lib/rancher/k3s/server/token
K10fb096c5dc65b65631cd714d4554ac3dd6c5643c085b798acd97d9640a9bec57d::server:bf175bc6408ff73d32c9ab6224bfbb4d
劳动者的建设
root@terraform-vm04:/home/tmcit# curl -sfL https://get.k3s.io |\
K3S_TOKEN="K10fb096c5dc65b65631cd714d4554ac3dd6c5643c085b798acd97d9640a9bec57d::server:bf175bc6408ff73d32c9ab6224bfbb4d" \
K3S_URL=https://172.24.20.201:6443 sh -
确认从管理系统构建集群。
NAME STATUS ROLES AGE VERSION
terraform-vm01 Ready control-plane,master 3m33s v1.27.3+k3s1
terraform-vm02 Ready <none> 99s v1.27.3+k3s1
terraform-vm03 Ready <none> 77s v1.27.3+k3s1