k8s 之docker环境部署 (三)

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

posted @   地铁昌平线  阅读(423)  评论(0编辑  收藏  举报
编辑推荐:
· AI与.NET技术实操系列:基于图像分类模型对图像进行分类
· go语言实现终端里的倒计时
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 零经验选手,Compose 一天开发一款小游戏!
· 因为Apifox不支持离线,我果断选择了Apipost!
· 通过 API 将Deepseek响应流式内容输出到前端
1.在node 21上安装docker2.在node22上安装docker3.在node200上安装docker
点击右上角即可分享
微信分享提示