当前位置:网站首页>[Zhao Yuqiang] deploy kubernetes cluster with binary package
[Zhao Yuqiang] deploy kubernetes cluster with binary package
2022-07-06 03:58:00 【Teacher zhaoyuqiang】
In the private environment of some enterprises, it may not be possible to connect to the external network . If you want to deploy in such an environment Kubernetes colony , Can collect Kubernetes Deploy by offline installation . namely : Deploy using binary installation packages Kubernetes colony , The version used is Kubernetes v1.18.20.
The following steps demonstrate how to deploy three nodes using binary packages Kubernetes colony .
1. Deploy ETCD
(1) from GitHub Upload and download ETCD Binary installation package for “etcd-v3.3.27-linux-amd64.tar.gz”.
(2) from cfssl Download the required media on the official website , And install cfssl.
Tips : cfssl Is a command line toolkit , This toolkit contains all the functions needed to run a certification authority .
(3) Create for generating CA Configuration files for certificates and private keys , Execute the following command :
(4) Generate CA Certificate and private key .
(5) In the catalog “/opt/ssl/etcd” Add file below “etcd-csr.json”, This file is used to generate ETCD Certificate and private key of , The contents are as follows :
Tips : There is only one deployed ETCD The node of . If it's deployment ETCD colony , You can modify the fields “hosts” Add multiple ETCD The node can be .
(6) install ETCD.
(7) Edit the file “/opt/platform/etcd/etcd.conf” add to ETCD Configuration information , The contents are as follows :
(8) take ETCD Services are added to system services , Edit the file “/usr/lib/systemd/system/etcd.service” The contents are as follows :
(9) establish ETCD Data storage directory , Then start ETCD service .
(10) verification ETCD The state of .
The output information is as follows :
(11) see ETCD Member list for .
The output information is as follows :
Tips : Because it is single node ETCD, So there is only one member information .
(12) take ETCD Copy of certificate file node1 and node2 Node .
2. Deploy Flannel The Internet
(1) stay master Write the allocated subnet segment on the node to ETCD Medium supply Flannel Use , Carry out orders :
(2) stay master View the written on the node Flannel Subnet information , Carry out orders :
The output information is as follows :
(3) stay node1 Decompress flannel-v0.10.0-linux-amd64.tar.gz Installation package , Carry out orders :
(4) stay node1 To create a Kubernetes working directory .
(5) stay node1 Defined on the Flannel Script files “ flannel.sh”, Enter the following :
(6) stay node1 Turn on the node Flannel Network function , Carry out orders :
Tips : It is specified here that master Deployed on the node ETCD Address .
(7) stay node1 View on the node Flannel The state of the network , Carry out orders :
The output information is as follows :
(8) stay node1 Modify the file on the node “/usr/lib/systemd/system/docker.service” To configure node1 nodes Docker Connect Flannel The Internet , Add the following line to the file :
(9) stay node1 Restart on node Docker service .
(10) see node1 nodes Flannel Internet Information , Pictured 13-3 Shown :
(11) stay node2 Configuration on node Flannel The Internet , Repeat the first 3 Step to step 10 Step .
3. Deploy Master node
(1) establish Kubernetes Cluster certificate Directory .
(2) Create script file “ k8s-cert.sh” Used to generate Kubernetes Certificate of cluster , Enter the following in the script :
(3) Execute script file “ k8s-cert.sh”.
(4) Copy certificate .
(5)) decompression kubernetes Compressed package
(6) Copy key command file
(7) Randomly generated serial number .
The output is as follows :
(8) establish “/opt/kubernetes/cfg/token.csv” file , Enter the following :
(9) establish API Server Configuration file for “/opt/kubernetes/cfg/kube-apiserver.conf”, Enter the following :
(10) Using the system's systemd To manage API Server, Carry out orders :
(11) start-up API Server.
(12) see API Server The state of .
The output information is as follows :
(13) View listening ports 6433 And port 8080 Information , Pictured 13-4 Shown .
(14) to grant authorization kubelet-bootstrap Users are allowed to request certificates .
(15) establish kube-controller-manager Configuration file for , Carry out orders :
(16) Use systemd Service to manage kube-controller-manager, Carry out orders
(17) start-up kube-controller-manager.
(18) see kube-controller-manager The state of .
The output information is as follows :
(19) establish kube-scheduler Configuration file for , Carry out orders :
(20) Use systemd Service to manage kube-scheduler, Carry out orders :
(21) start-up kube-scheduler.
(22) see kube-scheduler The state of .
The output information is as follows :
(23) see master Status information of the node .
The output information is as follows :
4. Deploy Node node
(1) stay master Create a script file on the node “kubeconfig”, Enter the following :
(2) Execute script file “kubeconfig”.
The output information is as follows :
(3) take master Copy the configuration file generated on the node to node1 Nodes and node2 node .
(4) stay node1 Unzip the file on the node “kubernetes-node-linux-amd64.tar.gz”.
(5) stay node1 The node will kubelet and kube-proxy Copy to directory “/opt/kubernetes/bin/” Next .
(6) stay node1 Create a script file on the node “ kubelet.sh”, Enter the following :
(7) stay node1 Execute the script file on the node “ kubelet.sh”.
Tips : Specified here node1 Node IP Address .
(8) stay node1 View on the node Kubelet The state of .
The output information is as follows :
kubelet.service - Kubernetes Kubelet Loaded: loaded (/usr/lib/systemd/system/kubelet.service; enabled; vendor preset: disabled) Active: active (running) since Tue 2022-02-08 23:23:52 CST; 3min 18s ago
(9) stay node1 Create a script file on the node “ proxy.sh”, Enter the following
(10) stay node1 Execute the script file on the node “ proxy.sh”.
(11) stay node1 View on the node kube-proxy The state of .
The output information is as follows :
(12) stay master Check on the node node1 The request information of the node to join the cluster , Carry out orders :
The output information is as follows :
(13) stay master Approved on node node1 Node's request , Carry out orders :
(14) stay master View on the node Kubernetes Node information in the cluster , Carry out orders :
The output information is as follows :
Tips : Now node1 The node has successfully joined Kubernetes In the cluster .
(15) stay node2 Repeat step 4 Step to step 14 Step , In the same way node2 Nodes join the cluster . (16) stay master View on the node Kubernetes Node information in the cluster , Carry out orders :
The output information is as follows :
So far, we have successfully deployed three nodes using binary packages Kubernetes colony .
边栏推荐
- 【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
- LTE CSFB test analysis
- Ipv4中的A 、B、C类网络及子网掩码
- C mouse event and keyboard event of C (XXVIII)
- Flask learning and project practice 9: WTF form verification
- Security xxE vulnerability recurrence (XXe Lab)
- [PSO] Based on PSO particle swarm optimization, matlab simulation of the calculation of the lowest transportation cost of goods at material points, including transportation costs, agent conversion cos
- Python book learning notes - Chapter 09 section 01 create and use classes
- No qualifying bean of type ‘......‘ available
- Basic concepts of LTE user experience
猜你喜欢
UDP reliable transport protocol (quic)
【可调延时网络】基于FPGA的可调延时网络系统verilog开发
C (XXIX) C listbox CheckedListBox Imagelist
Database, relational database and NoSQL non relational database
JVM的手术刀式剖析——一文带你窥探JVM的秘密
How does technology have the ability to solve problems perfectly
Custom event of C (31)
Factors affecting user perception
【PSO】基于PSO粒子群优化的物料点货物运输成本最低值计算matlab仿真,包括运输费用、代理人转换费用、运输方式转化费用和时间惩罚费用
【按键消抖】基于FPGA的按键消抖模块开发
随机推荐
MySQL reads missing data from a table in a continuous period of time
20、 EEPROM memory (AT24C02) (similar to AD)
Ipv4中的A 、B、C类网络及子网掩码
AcWing 243. A simple integer problem 2 (tree array interval modification interval query)
[Qt5] QT QWidget immediately appears and disappears
asp. Core is compatible with both JWT authentication and cookies authentication
Schnuka: 3D vision detection application industry machine vision 3D detection
Facebook等大廠超十億用戶數據遭泄露,早該關注DID了
Thread sleep, thread sleep application scenarios
WPF effect Article 191 box selection listbox
【FPGA教程案例12】基于vivado核的复数乘法器设计与实现
【按键消抖】基于FPGA的按键消抖模块开发
[adjustable delay network] development of FPGA based adjustable delay network system Verilog
The Research Report "2022 RPA supplier strength matrix analysis of China's banking industry" was officially launched
Detailed explanation of serialization and deserialization
Error 1045 (28000): access denied for user 'root' @ 'localhost' (using password: no/yes
[Key shake elimination] development of key shake elimination module based on FPGA
DM8 backup set deletion
WPF效果第一百九十一篇之框选ListBox
Redis (replicate dictionary server) cache