----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15or16or18
查看

----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15and16and18
将etcd二进制服务放入到可执行目录

----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15and16and18
启动测试

----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15or16or18
启动三个主机的etcd
for node in {k8s-master-1,k8s-master-2,k8s-master-3};do ssh ${node} "systemctl daemon-reload && systemctl restart etcd"; done
----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15or16or18
测试etcd集群是否正常
etcdctl \ --ca-file=/etc/kubernetes/ssl/k8s-root-ca.pem\ --cert-file=/etc/kubernetes/ssl/kubernetes.pem \ --key-file=/etc/kubernetes/ssl/kubernetes-key.pem \ cluster-health

----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15or16or18
设置集群网络范围
etcdctl --endpoints=https://192.168.1.15:2379,https://192.168.1.16:2379,https://192.168.1.18:2379 \
--ca-file=/etc/kubernetes/ssl/k8s-root-ca.pem \
--cert-file=/etc/kubernetes/ssl/kubernetes.pem \
--key-file=/etc/kubernetes/ssl/kubernetes-key.pem \
mkdir /kubernetes/network
----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15or16or18
etcdctl --endpoints=https://192.168..1.15:2379,https://192.168.1.16:2379,https://192.168.1.18:2379 \
--ca-file=/etc/kubernetes/ssl/k8s-root-ca.pem\
--cert-file=/etc/kubernetes/ssl/kubernetes.pem \
--key-file=/etc/kubernetes/ssl/kubernetes-key.pem \
mk /kubernetes/network/config '{ "Network": "10.254.0.0/16", "Backend": { "Type": "vxlan", "VNI": 1 }}'

----------------------------------------------------------------------------------------------------------------------------
执行主机:192.168.1.15adn16and18
启动docker
systemctl restart docker

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐