1.在node 21上安装docker

  1. [root@hdss7-21 ~]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
  2. [root@hdss7-21 ~]# mkdir -p /data/docker
  3. [root@hdss7-21 ~]# mkdir -p /etc/docker
  4. [root@hdss7-21 ~]# vim /etc/docker/daemon.json
  5. [root@hdss7-21 ~]# cat /etc/docker/daemon.json
  6. {
  7. "graph": "/data/docker",
  8. "storage-driver": "overlay2",
  9. "insecure-registries": ["registry.access.redhat.com","quay.io","harbor.od.com"],
  10. "registry-mirrors": ["https://q2gr04ke.mirror.aliyuncs.com"],
  11. "bip": "172.7.21.1/24",
  12. "exec-opts": ["native.cgroupdriver=systemd"],
  13. "live-restore": true
  14. }
  15. [root@hdss7-21 ~]# systemctl start docker
  16. [root@hdss7-21 ~]# systemctl enable docker
  17. Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
  18. [root@hdss7-21 ~]# docker info

2.在node22上安装docker

[root@hdss7-22 ~]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
[root@hdss7-22 ~]# mkdir -p /etc/docker
[root@hdss7-22 ~]# mkdir -p /data/docker
[root@hdss7-22 ~]# vim /etc/docker/daemon.json
[root@hdss7-22 ~]# cat /etc/docker/daemon.json 
{
  "graph": "/data/docker",
  "storage-driver": "overlay2",
  "insecure-registries": ["registry.access.redhat.com","quay.io","harbor.od.com"],
  "registry-mirrors": ["https://q2gr04ke.mirror.aliyuncs.com"],
  "bip": "172.7.22.1/24",
  "exec-opts": ["native.cgroupdriver=systemd"],
  "live-restore": true
}
[root@hdss7-22 ~]# systemctl start docker
[root@hdss7-22 ~]# systemctl enable docker

3.在node200上安装docker

[root@hdss7-200 ~]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
root@hdss7-200 ~]# mkdir -p /etc/docker
[root@hdss7-200 ~]# mkdir -p /data/docker
[root@hdss7-200 ~]# vim /etc/docker/daemon.json
[root@hdss7-200 ~]# 
[root@hdss7-200 ~]# 
[root@hdss7-200 ~]# 
[root@hdss7-200 ~]# cat /etc/docker/daemon.json 
{
  "graph": "/data/docker",
  "storage-driver": "overlay2",
  "insecure-registries": ["registry.access.redhat.com","quay.io","harbor.od.com"],
  "registry-mirrors": ["https://q2gr04ke.mirror.aliyuncs.com"],
  "bip": "172.7.200.1/24", # 定义k8s主机上k8s pod的ip地址网段 -- 改成node节点的ip
  "exec-opts": ["native.cgroupdriver=systemd"],
  "live-restore": true
}
[root@hdss7-200 ~]# systemctl start docker
[root@hdss7-200 ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[root@hdss7-200 ~]# docker info