您好,登錄后才能下訂單哦!
接上一篇單節點部署(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
[root@master02 ~]# systemctl stop firewalld.service
[root@master02 ~]# setenforce 0
[root@master01 k8s]# scp -r /opt/kubernetes/ root@192.168.13.130:/opt
##復制kubernetes目錄到master02
[root@master01 k8s]# scp /usr/lib/systemd/system/{kube-apiserver,kube-controller-manager,kube-scheduler}.service root@192.168.13.130:/usr/lib/systemd/system/
##復制master中的三個組件啟動腳本
[root@master02 ~]# cd /opt/kubernetes/cfg/
[root@master02 cfg]# vim kube-apiserve ##修改apiserver配置文件
--bind-address=192.168.13.130 \ ##修改地址
--secure-port=6443 \
--advertise-address=192.168.13.130 \ ##修改地址
[root@master01 k8s]# scp -r /opt/etcd/ root@192.168.13.130:/opt/
##在master02中操作
[root@master02 cfg]# systemctl start kube-apiserver.service ##開啟服務
[root@master02 cfg]# systemctl enable kube-apiserver.service
[root@master02 cfg]# systemctl start kube-controller-manager.service
[root@master02 cfg]# systemctl enable kube-controller-manager.service
[root@master02 cfg]# systemctl start kube-scheduler.service
[root@master02 cfg]# systemctl enable kube-scheduler.service
[root@master02 cfg]# vim /etc/profile
export PATH=$PATH:/opt/kubernetes/bin/ ##添加環境變量
[root@master02 cfg]# source /etc/profile ##刷新配置文件
[root@master02 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
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。