Kubernetes二进制部署——多master节点集群部署(2)
前言:
接上一篇单节点部署(1)部署多节点
部署环境
负载均衡
Nginx1:192.168.13.128/24
Nginx2:192.168.13.129/24
Master节点
master1:192.168.13.131/24 kube-apiserver kube-controller-manager kube-scheduler etcd
master2:192.168.13.130/24 kube-apiserver kube-controller-manager kube-scheduler etcd
Node节点
node1:192.168.13.132/24 kubelet kube-proxy docker flannel etcd
node2:192.168.13.133/24 kubelet kube-proxy docker flannel etcd
master02的部署
1,关闭master02防火墙
[ ~]# systemctl stop firewalld.service [ ~]# setenforce 0
2,从master01中复制kubernetes目录,组件server服务到master02
[ k8s]# scp -r /opt/kubernetes/ :/opt ##复制kubernetes目录到master02 [ k8s]# scp /usr/lib/systemd/system/{kube-apiserver,kube-controller-manager,kube-scheduler}.service :/usr/lib/systemd/system/ ##复制master中的三个组件启动脚本
3,修改master02中的配置文件
[ ~]# cd /opt/kubernetes/cfg/ [ cfg]# vim kube-apiserve ##修改apiserver配置文件 --bind-address=192.168.13.130 \ ##修改地址 --secure-port=6443 --advertise-address=192.168.13.130 \ ##修改地址
4,在master01上拷贝已有的etcd证书给master02使用(master02一定要有etcd证书,否则apiserver服务无法启动)
[ k8s]# scp -r /opt/etcd/ :/opt/ ##在master02中操作 [ cfg]# systemctl start kube-apiserver.service ##开启服务 [ cfg]# systemctl enable kube-apiserver.service [ cfg]# systemctl start kube-controller-manager.service [ cfg]# systemctl enable kube-controller-manager.service [ cfg]# systemctl start kube-scheduler.service [ cfg]# systemctl enable kube-scheduler.service
5,修改环境变量
[ cfg]# vim /etc/profile export PATH=$PATH:/opt/kubernetes/bin/ ##添加环境变量 [ cfg]# source /etc/profile ##刷新配置文件 [ cfg]# kubectl get node ##查看群集节点信息 NAME STATUS ROLES AGE VERSION 192.168.13.132 Ready <none> 75m v1.12.3 192.168.13.133 Ready <none> 55m v1.12.3
多master节点部署完成,未完待续...
相关推荐
CurrentJ 2020-08-18
朱培知浅ZLH 2020-11-16
cdbdqn00 2020-11-12
达观数据 2020-11-11
JustinChia 2020-11-11
远远的山 2020-11-09
jingtao 2020-11-08
大叔比较胖 2020-10-30
gracecxj 2020-10-30
onepiecedn 2020-10-29
kunyus 2020-10-28
JustHaveTry 2020-10-27
锋锋 2020-10-26
hubanbei00的家园 2020-10-25
谢恩铭 2020-10-23
btqszl 2020-10-21
kaidiphp 2020-10-13
guchengxinfen 2020-10-12
liverlife 2020-10-10