yasi123 / kube-install

一鍵安裝部署高可用的多kubernetes集羣(二進位離線方式),支持定時安裝、添加與銷毀node、銷毀與修復master、一鍵卸載集羣等。One click offline installation of highly available multiple kubernetes cluster, supports schedule installation, addition of nodes, rebuild of kubernetes master, and uninstallation of clusters.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The highly available multiple kubernetes cluster can be installed offline with one click in binary mode, as well as schedule installation, addition of kubernetes node, deletion of kubernetes node, destruction of kubernetes master, rebuild of kubernetes master, and uninstallation of cluster.
(There is no need to install any software on the target host. You can deploy the highly available kubernetes cluster offline only by using an empty host!)

kube-install


Switch Languages: English Documents | 繁体中文文档 | 简体中文文档 | 日本語の文書


[1] Compatibility


Compatibility matrix:
kube-install VersionSupported Kubernetes VersionSupported OS VersionDocumentation
kube-install v0.7.* kubernetes v1.23, v1.22, v1.20, v1.19, v1.18, v1.17 CentOS 7 , RHEL 7 , CentOS 8 , RHEL 8 , SUSE Linux 15 , Ubuntu 20 README0.7.md
kube-install v0.6.* kubernetes v1.22, v1.21, v1.20, v1.19, v1.18, v1.17, v1.16, v1.15, v1.14 CentOS 7 , RHEL 7 , CentOS 8 , RHEL 8 , SUSE Linux 15 README0.6.md
kube-install v0.5.* kubernetes v1.21, v1.20, v1.19, v1.18, v1.17, v1.16, v1.15, v1.14 CentOS 7 , RHEL 7 README0.5.md
kube-install v0.4.* kubernetes v1.21, v1.20, v1.19, v1.18, v1.17, v1.16, v1.15, v1.14 CentOS 7 , RHEL 7 README0.4.md
kube-install v0.3.* kubernetes v1.18, v1.17, v1.16, v1.15, v1.14 CentOS 7README0.3.md
kube-install v0.2.* kubernetes v1.14 CentOS 7 README0.2.md
kube-install v0.1.* kubernetes v1.14 CentOS 7 README0.1.md

Notice: kube-install supports CentOS 7, CentOS 8, SUSE 15, RHEL 7 and RHEL 8 operating system environments. For a list of supported operating system distributions, please refer to OS support list.


[2] Download kube-install package


You can download the kube-install-*.tgz package from https://github.com/cloudnativer/kube-install/releases.

For example, we have downloaded the kube-install-allinone-v0.7.3.tgz package.

# cd /root/
# curl -O https://github.com/cloudnativer/kube-install/releases/download/v0.7.3/kube-install-allinone-v0.7.3.tgz
# tar -zxvf kube-install-allinone-v0.7.3.tgz
# cd /root/kube-install/

Notice: If your network quality is poor and the download package is slow, you can use the download tool that supports breakpoint continuation to download.




[3] Install kubernetes cluster by CLI


If you have four servers,kubernetes master software is installed on the three servers (192.168.1.11, 192.168.1.12, 192.168.1.13), and kubernetes node software is installed on the four servers (192.168.1.11, 192.168.1.12, 192.168.1.13, 192.168.1.14). The operating system of the server is pure CentOS Linux or RHEL(Red Hat Enterprise Linux). It's like this:

IP AddressRoleOS VersionRoot Password
192.168.1.11k8s-master,k8s-node,kube-installCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.12k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.13k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.14k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
You expect the architecture after installation to be as follows:

kube-install-arch


Notice: We use 192.168.1.11 as the kube-install host. In fact, you can use any host as kube-install host or any host outside the kubernetes cluster!

3.1 Initialize system environment


Please operate in the root user environment. Perform the system environment initialization operation on the kube-install host selected above:
# cd /root/kube-install/
# ./kube-install -init -ostype "centos7"

Notice: Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, ubuntu20, suse15 these types of "ostype".


3.2 Open the SSH password free channel


Before installation, please open the SSH password free channel from localhost to the target host.

You can open the SSH password free channel by manually, or using the kube-install -exec sshcontrol command.

# cd /root/kube-install/
# ./kube-install -exec sshcontrol -sship "192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14" -sshpass "cloudnativer"

Or click the Open SSH Channel of Host button in the web platform to SSH through. Here is the process of SSH connection, click here to view more details !


3.3 One click Install kubernetes cluster


Please operate in the root user environment. Execute on the kube-install host selected above:
# cd /root/kube-install/
# ./kube-install -exec install -master "192.168.1.11,192.168.1.12,192.168.1.13" -node "192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14" -k8sver "1.22" -ostype "centos7" -label "192168001011"

Notice:

  • Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, ubuntu20, suse15 these types of "ostype". Since the lower versions of CentOS 7 and RedHat 7 may lack kernel modules, 'Kube install' provides the function of automatically upgrading the operating system kernels of CentOS 7 and rhel7 to 4.19. You can choose to use this function by -upgradekernel or manually optimize the operating system kernel yourself.
  • Please select the CNI plug-ins you need to install. At present, 'Kube install' supports CNI plug-ins such as Flannel, Calico, Kube-router, weave and Cilium. If you need to install "cilium", please upgrade the Linux kernel to version 4.9 or above.

In addition, if you need to specify the directory path to the Kubernetes cluster installation, you can set it using the -softdir parameter.


3.4 Login kubernetes dashboard UI


Execute the following command on the kube-install you selected to view the kube-dashboard console URL and key:
# cat /opt/kube-install/loginkey.txt

loginkey

Login to the kube-dashboard console UI using the URL and key in the /opt/kube-install/loginkey.txt document.Here are the relevant screenshots:

kube-dashboard

kube-dashboard


[4] Install kubernetes cluster by web platform


You can also install the Kubernetes cluster using the kube-install web platform.

4.1 Initialize system environment


Please operate in the root user environment. Perform the system environment initialization operation on the kube-install host selected above:
# cd /root/kube-install/
# ./kube-install -init -ostype "centos7"

Notice: Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, ubuntu20, suse15 these ty pes of "ostype".


4.2 Run kube-install web service

First run the web management service with the systemctl start kube-install command, and then open http://your_kube-install_host_IP:9080 with a web browser.

# systemctl start kube-install.service
#
# systemctl status kube-install.service
  ● kube-install.service - kube-install One click fast installation of highly available kubernetes cluster.
     Loaded: loaded (/etc/systemd/system/kube-install.service; disabled; vendor preset: disabled)
     Active: active (running) since Fri 2021-08-20 14:30:55 CST; 21min ago
       Docs: https://cloudnativer.github.io/
   Main PID: 2768 (kube-install)
     CGroup: /system.slice/kube-install.service
             └─2768 /go/src/kube-install/kube-install -daemon
   ...

Notice: Kube-install web service listens to TCP 9080 by default. If you want to modify the listening address, you can set it by modifying the kube-install -daemon -listen ip:port parameter in the /etc/systemd/system/kube-install.service file, click here to view more details !

4.3 Use the web platform to install

Second, Click the Install Kubernetes button in the upper right corner to start the installation operation.

kube-dashboard

Notice: Before starting the installation, please open the SSH password free channel from localhost to the target host.You can use the kube-install -exec sshcontrol command to SSH through, or click the Open SSH Channel of Host button in the upper right corner to SSH through. Here is the process of SSH connection, click here to view more details !

kube-dashboard

For the installation process using the web platform, click here to view more details !


[5] Add Node, Delete Node, Rebuild Master, and Uninstall


Kube-install can not only quickly install the highly available kubernetes cluster, but also add k8s-node, delete k8s-node, delete k8s-master and rebuild k8s-master.

Suppose you expect to install two servers (192.168.1.15 and 192.168.1.16) as k8s-nodes and join the kubernetets cluster in Chapter [2].

IP AddressRoleOS VersionRoot Password
192.168.1.11k8s-master,k8s-node,kube-installCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.12k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.13k8s-master,k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.14k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.15k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer
192.168.1.16k8s-nodeCentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7cloudnativer

Execute the following command on kube-install host:

# kube-install -exec addnode -node "192.168.1.15,192.168.1.16" -k8sver "1.22" -ostype "centos7" -label "192168001011"

Notice: Please make sure that the -ostype flag you entered is correct, only support rhel7, rhel8, centos7, centos8, ubuntu20, suse15 these types of "ostype".
In addition, if you need to specify the directory path to add Kubernetes node, you can set it using the -softdir parameter.


The architecture after installation is shown in the following figure:

kube-install-arch

You can also add Kubernetes node using the kube-install web platform. For the installation process using the web platform, click "Add Node" to fill in the form to complete the expansion of Kubernetes node. click here to view more details !

kube-dashboard

You can click "Enable Terminal" and "Web Terminal" to use the Web terminal to manage the Kubernetes node server.

Notice: you can click here to view more operation documents about add k8s-node, delete k8s-node, delete k8s-master, rebuild k8s-master, and uninstall cluster.



[6] Command line help documentation


You can execute kube-install -help command to view the command line help document of kube-install, or click here to view more command line help documents.



[7] How to build it


The build can be completed automatically by executing the make command. You can also see more detailed build instructions here.



[8] How to Contribute

If you have problems in use, you can click here submit issues to us, or fork it and submit PR.

# git clone your-fork-code
# git checkout -b your-new-branch
# git commit -am "Fix bug or add some feature"
# git push origin your-new-branch

Welcome to submit issues or PR to us.
Thank you to every contributor!


About

一鍵安裝部署高可用的多kubernetes集羣(二進位離線方式),支持定時安裝、添加與銷毀node、銷毀與修復master、一鍵卸載集羣等。One click offline installation of highly available multiple kubernetes cluster, supports schedule installation, addition of nodes, rebuild of kubernetes master, and uninstallation of clusters.

License:Apache License 2.0


Languages

Language:JavaScript 42.5%Language:Jinja 28.4%Language:Go 18.2%Language:CSS 9.8%Language:Shell 0.6%Language:HTML 0.5%Language:Makefile 0.0%