1、下载并解压sealos
tar zxvf sealos_4.1.3_linux_amd64.tar.gz
cp sealos /usr/bin/
2、导入镜像,只在节点master1上导入即可
sealos load -i /app/k8s-1.21/k8s-1.21.0.tar
sealos load -i /app/k8s-1.21/calico-3.22.1.tar
3、部署k8s集群
方式一:
sealos run labring/kubernetes:v1.21.0 labring/calico:v3.22.1 \
--masters x.x.x.x,x.x.x.x,x.x.x.x \
-p '123456'
方式二:
sealos gen labring/kubernetes:v1.21.0 labring/calico:v3.22.1 \
--masters x.x.x.x,x.x.x.x,x.x.x.x \
--passwd '123456' > Clusterfile
sealos apply -f /root/Clusterfile
4、查看node节点状态,Ready为正常
kubectl get nodes
5、去除node节点的污点
kubectl taint node master1 node-role.kubernetes.io/master:NoSchedule-
kubectl taint node master2 node-role.kubernetes.io/master:NoSchedule-
kubectl taint node node1 node-role.kubernetes.io/master:NoSchedule-
6、重启coredns
kubectl rollout restart deploy coredns -n kube-system
7、修改internal-ip,在KUBELET_EXTRA_ARGS参数的最后加上node节点eth1的IP地址
vim /var/lib/kubelet/kubelet-flags.env
KUBELET_EXTRA_ARGS="--pod-infra-container-image=k8s.gcr.io/pause:3.4.1 --container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock --image-service-endpoint=unix:///var/run/image-cri-shim.sock --node-ip=x.x.x.x"
#重启kubelet服务
systemctl daemon-reload
systemctl restart kubelet
#确认k8s集群节点的internal-ip是否已经修改
kubectl get nodes -o wide
参考链接:
https://sealos.io/docs/lifecycle-management/quick-start/
https://icloudnative.io/posts/getting-started-with-containerd/ # Containerd使用教程
https://blog.csdn.net/xiaoliizi/article/details/126998976
https://github.com/wheatMr/sealos
https://github.com/labring/sealos
https://github.com/KubeOperator/KubeOperator
https://icloudnative.io/posts/kubesphere/
https://www.kubesphere.io/zh/docs/v3.3/quick-start/all-in-one-on-linux/ #在linux上安装Kubernetes和KubeSphere
https://asciinema.org/ # 终端录制,安装前需要安装epel源
https://www.cnblogs.com/lifuqiang/articles/16815740.html #安装containerd