Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deploy Kubernetes with multiple nodes

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

This article is about Kubernetes multi-node deployment. The editor thought it was very practical, so I shared it with you to learn. The following information is about Kubernetes multi-node deployment.

Environment preparation role address installation component master192.168.142.129kube-apiserver kube-controller-manager kube-scheduler etcdmaster2192.168.142.120kube-apiserver kube-controller-manager kube-schedulernode1192.168.142.130kubelet kube-proxy docker flannel etcdnode2192.168.142.131kubelet kube-proxy docker flannel etcdnginx1 (lbm) 192.168.142.140nginx keepalivednginx2 (lbb) 192.168.142.150nginx keepalivedVIP192.168.142.20-

Resource Kit links:

Https://pan.baidu.com/s/183G9ZzBNdcUUFV7Y8-K4CQ extraction code: 6z0j 1. Deploy Master2

1. Remote replication of master related directories

Turn off firewall and security functions systemctl stop firewalld.servicesetenforce 0 copy kubernetes directory to master2scp-r / opt/kubernetes/ root@192.168.142.120:/opt copy etcd directory to master2 (including certificates) scp-r / opt/etcd/ root@192.168.142.120:/opt replication service startup script to master2scp / usr/lib/systemd/system/ {kube-apiserver,kube-controller-manager,kube-scheduler} .service root@192.168.142.120:/usr/lib/systemd/system/

two。 Modify kube-apiserver configuration file

Vim / opt/kubernetes/cfg/kube-apiserver# changes lines 5 and 7 IP address to the address of the master2 host-- bind-address=192.168.142.120\-- advertise-address=192.168.142.120\

3. Start the service and set to boot automatically

Systemctl start kube-apiserver.servicesystemctl enable kube-apiserver.servicesystemctl start kube-controller-manager.servicesystemctl enable kube-controller-manager.servicesystemctl start kube-scheduler.servicesystemctl enable kube-scheduler.service

4. Append environment variables and take effect

Add export PATH=$PATH:/opt/kubernetes/bin/source / etc/profile at the end of vim / etc/profile#

5. View the node node

Kubectl get nodeNAME STATUS ROLES AGE VERSION192.168.142.130 Ready 10d12h v1.12.3192.168.142.131 Ready 10d11h v1.12.3 II, Nginx load balance deployment-keeplived service

1. Operation on the lbm& LBB side to install the nginx service

Copy the nginx.sh and keepalived.conf scripts to the home directory (used later) # nginx.shcat > / etc/yum.repos.d/nginx.repo dashboard-csr.json

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report