K8S—单节点部署—flannel网络(2)
一.Flannel网络部署
1.部署flannel网络之前需要安装docker引擎(参考之前的docker博客)
https://blog.csdn.net/obsessiveY/article/details/105418643
2.在master端分配子网段到etcd中,供给flannel使用
[root@localhost etcd-cert]# /opt/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.88.11:2379,https://192.168.88.13:2379,https://192.168.88.14:2379" set /coreos.com/network/config '{ "Network": "172.17.0.0/16", "Backend": {"Type": "vxlan"}}'
{ "Network": "172.17.0.0/16", "Backend": {"Type": "vxlan"}}
3.查看写入的信息
[root@localhost etcd-cert]# /opt/etcd/bin/etcdctl --ca-file=ca.pem --cert-file=server.pem --key-file=server-key.pem --endpoints="https://192.168.88.11:2379,https://192.168.88.13:2379,https://192.168.88.14:2379" get /coreos.com/network/config
{ "Network": "172.17.0.0/16", "Backend": {"Type": "vxlan"}}
4.把软件复制到node节点
[root@localhost k8s]# scp flannel-v0.10.0-linux-amd64.tar.gz root@192.168.88.13:/root
root@192.168.88.13's password:
flannel-v0.10.0-linux-amd64.tar.gz