首页 > 其他 > 详细

k8s 之docker环境部署 (三)

时间:2020-06-06 13:54:24      阅读:76      评论:0      收藏:0      [点我收藏+]

1.在node 21上安装docker

[root@hdss7-21 ~]# curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
[root@hdss7-21 ~]# mkdir -p /data/docker
[root@hdss7-21 ~]# mkdir -p /etc/docker
[root@hdss7-21 ~]# vim /etc/docker/daemon.json
[root@hdss7-21 ~]# 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.21.1/24",
  "exec-opts": ["native.cgroupdriver=systemd"],
  "live-restore": true
} 
[root@hdss7-21 ~]# systemctl start docker
[root@hdss7-21 ~]# systemctl enable docker
Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service.
[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

 原文章已同步语雀

https://www.yuque.com/songyifei/bkxwl0/ygcgxt

k8s 之docker环境部署 (三)

原文:https://www.cnblogs.com/sseban/p/13054111.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!