docker 安装
1、一键安装
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
curl -sSL https://get.daocloud.io/docker | sh
2、源安装
依赖
yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
阿里云
$ sudo yum-config-manager \
--add-repo \
http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
清华大学源
$ sudo yum-config-manager \
--add-repo \
https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/centos/docker-ce.repo
sudo yum install docker-ce docker-ce-cli containerd.io
yum list docker-ce --showduplicates | sort -r
sudo systemctl status docker
sudo systemctl enable docker
sudo systemctl start docker
3、sealos 部署kubernetes集群
https://github.com/fanux/sealos
https://blog.csdn.net/xixihahalelehehe/article/details/105567076
只需要准备好服务器,在任意一台服务器上执行下面命令即可
# 下载并安装sealos, sealos是个golang的二进制工具,直接下载拷贝到bin目录即可, release页面也可下载
$ wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/latest/sealos && \
chmod +x sealos && mv sealos /usr/bin
# 下载离线资源包
$ wget -c https://sealyun.oss-cn-beijing.aliyuncs.com/7b6af025d4884fdd5cd51a674994359c-1.18.0/kube1.18.0.tar.gz
修改主机名
hostnamectl set-hostname kmaster
hostnamectl set-hostname knode1
hostnamectl set-hostname knode2
cat >> /etc/hosts < 192.168.118.18 kmaster 192.168.118.19 knode1 192.168.118.20 knode2 EOF sealos init --master 192.168.118.18 \ --node 192.168.118.19 \ --node 192.168.118.20 \ --user root \ --passwd rootroot \ --version v1.18.0 \ --pkg-url /root/kube1.18.0.tar.gz # 安装一个三master的kubernetes集群 $ sealos init --passwd 123456 \ --master 192.168.0.2 --master 192.168.0.3 --master 192.168.0.4 \ --node 192.168.0.5 \ --pkg-url /root/kube1.18.0.tar.gz \ --version v1.18.0 清理 sealos clean \ --master 192.168.0.2 \ --master 192.168.0.3 \ --master 192.168.0.4 \ --node 192.168.0.5 \ --user root \ --passwd your-server-password kubectl get node kubectl get pod --all-namespaces