Skip to content

一键安装k8s(kubernetes):二進位離線方式部署,支持定時安裝、添加與銷毀node、銷毀與修復master、一鍵卸載集羣等。Install k8s (kubernetes): 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

Notifications You must be signed in to change notification settings

cloudnativer/kube-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.9.* kubernetes v1.28, v1.27, v1.26, v1.25, v1.24 CentOS 7 , RHEL 7 , CentOS 8 , RHEL 8 , SUSE Linux 15 , Ubuntu Server 20 Documentation,
Component List
kube-install v0.8.* kubernetes v1.24, v1.23, v1.22, v1.20, v1.19, v1.18 CentOS 7 , RHEL 7 , CentOS 8 , RHEL 8 , SUSE Linux 15 , Ubuntu Server 20 View details
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 Server 20 View details
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 View details
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 View details
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 View details
kube-install v0.3.* kubernetes v1.18, v1.17, v1.16, v1.15, v1.14 CentOS 7View details
kube-install v0.2.* kubernetes v1.14 CentOS 7 View details
kube-install v0.1.* kubernetes v1.14 CentOS 7 View details

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.9.0-beta.tgz package.

# cd /root/
# curl -O https://github.com/cloudnativer/kube-install/releases/download/v0.9.0-beta/kube-install-allinone-v0.9.0-beta.tgz
# tar -zxvf kube-install-allinone-v0.9.0-beta.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 web platform


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 ty pes of "ostype".


3.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.
Login with the user name admin and the default password CloudNativeR. You can change the password later through the web platform.

# 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 !

3.3 Use the web platform to quick 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 !


Fill in relevant installation parameters in the pop-up form:

kube-dashboard

explain:

  • Please select the version of kubernetes you need to install. At present, kube-install supports the installation and deployment of kubernetes v1.24 to 1.28. Other versions of kubernetes have not been verified yet.
  • 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.
  • Please select your operating system environment. Since the lower versions of CentOS 7 and RHEL 7 may lack kernel modules, kube-install provides the function of automatically upgrading the operating system kernels of CentOS 7 and RHEL 7 to 4.19. You can choose to use this function or manually optimize the operating system kernel yourself.

Notice: The default is to start the installation immediately. You can also set an installation time for scheduled installation.

kube-dashboard

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


[4] Install kubernetes cluster by command line


You can also install the Kubernetes cluster by command line.

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 types of "ostype".


4.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 !


4.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.28" -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.


4.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



[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.28" -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] kube-install cluster architecture


The ./data/ directory is used to store all status information of kube-install, including configuration information of all kubernetes clusters. You can share the ./data/ directory through file storage, so as to realize active and standby or load balancing cluster. you can click here to view more description documents about Active/standby and Load balancing cluster architecture.

architecture



[8] How to build it


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



[9] 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

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •