下载sealos工具
官方文档页面
https://sealos.run/docs/self-hosting/lifecycle-management/quick-start/install-cli
wget https://github.com/labring/sealos/releases/download/v4.3.7/sealos_4.3.7_linux_amd64.tar.gz
部署
1、配置ssh免密,或者使用密码方式验证
2、使用gen自定义ENV,我是为了自定义containerd数据目录。我选择先部署master,然后再join node
sealos gen registry.cn-shanghai.aliyuncs.com/labring/kubernetes:v1.27.13 \
registry.cn-shanghai.aliyuncs.com/labring/helm:v3.9.4 \
registry.cn-shanghai.aliyuncs.com/labring/cilium:v1.13.4 \
-e criData=/data/containerd \
--masters 192.168.31.100 \
-i /root/.ssh/id_rsa -o Clusetrfile
3、应用配置文件
sealos apply -f Clusetrfile
4、添加节点,如果出现ssh错误,确认ssh私钥文件位置
sealos add --nodes 192.168.31.111-192.168.31.112
5、节点添加完成,查看集群节点状态
root@k8s-master-100:/data/sealos# kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master-100 Ready control-plane 65s v1.27.13
k8s-node-111 Ready <none> 20s v1.27.13
k8s-node-112 Ready <none> 20s v1.27.13
6、配置kubectl命令补全
echo 'source <(kubectl completion bash)' >>~/.bashrc
source ~/.bashrc
7、如果部署出现问题
删除集群重新部署
sealos reset