三台机器

k8s with flanneld

kmaster 192.168.1.201

kslave202 192.168.1.202

kslave203 192.168.1.203

 

安装好k8s

 

1. 在Node机器上安装flanneld

yum install flannel

 

2. 配置flannel需要用到的Etcd,在Master机器上

etcdctl set /coreos.com/network/config '{ "Network": "172.21.0.0/16" }'

当Node机器的flannel连接上Etcd后,会创建路由表

k8s with flanneld

这里显示的172.21.11.0以及172.21.44.0是在Node机器上,Flannel自动为Docker设置的代理IP

 

3. 配置Node机器上的Flannel

k8s with flanneld

将Flannel的配置应用至Node机器,并刷新Docker网卡

systemctl enable flanneld

systemctl start flanneld

/run/flannel/subnet.env

ifconfig docker0 ${FLANNEL_SUBNET}

 

重启Docker

systemctl restart docker

 

查看网卡信息

k8s with flanneld

 

 

启动k8s集群,在不同的Node新增Pod,测试是否能互相Ping通

master

k8s with flanneld

 

kslave202

k8s with flanneld

kslave203

k8s with flanneld

 

kslave202容器与kslave203容器互ping

k8s with flanneld

k8s with flanneld

 

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-08-27
  • 2021-11-30
  • 2021-06-27
猜你喜欢
  • 2022-12-23
  • 2021-10-26
  • 2021-09-19
  • 2021-11-30
  • 2021-08-31
  • 2022-12-23
  • 2021-05-20
相关资源
相似解决方案