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

Repository files navigation

The highly available kubernetes cluster can be installed offline with one click in binary mode, as well as 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] How to install?


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!

2.1 Download kube-install package file


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.0.tgz package.

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


2.2 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 -exec 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".


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


2.4 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".
In addition, if you need to specify the directory path to the Kubernetes cluster installation, you can set it using the -softdir parameter.


2.5 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


[3] Use the web platform to install kubernetes cluster


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

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 !

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 !


[4] 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 here to view more details !

kube-dashboard


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.



[5] 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.



[6] How to build it


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



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