One click fast installation of highly available kubernetes cluster, as well as addition of kubernetes node, deletion of kubernetes node, destruction of kubernetes master, rebuild of kubernetes master, and uninstallation of cluster in later operation and maintenance stage.
Kube-install and kubernetes version correspondence:
kube-install Version | Installation package to download | Supported installed versions |
kube-install v0.1.* | kube-install-for-k8s1.14-v0.1.*.tgz | Install kubernetes v1.14.* |
kube-install v0.2.* | kube-install-for-k8s1.14-v0.2.*.tgz | Install kubernetes v1.14.* |
kube-install v0.3.* | kube-install-for-k8s1.14-v0.3.*.tgz | Install kubernetes v1.14.* |
kube-install v0.3.* | kube-install-for-k8s1.15-v0.3.*.tgz | Install kubernetes v1.15.* |
kube-install v0.3.* | kube-install-for-k8s1.16-v0.3.*.tgz | Install kubernetes v1.16.* |
kube-install v0.3.* | kube-install-for-k8s1.17-v0.3.*.tgz | Install kubernetes v1.17.* |
kube-install v0.3.* | kube-install-for-k8s1.18-v0.3.*.tgz | Install kubernetes v1.18.* |
kube-install v0.4.* | kube-install-for-k8s1.14-v0.4.*.tgz | Install kubernetes v1.14.* |
kube-install v0.4.* | kube-install-for-k8s1.15-v0.4.*.tgz | Install kubernetes v1.15.* |
kube-install v0.4.* | kube-install-for-k8s1.16-v0.4.*.tgz | Install kubernetes v1.16.* |
kube-install v0.4.* | kube-install-for-k8s1.17-v0.4.*.tgz | Install kubernetes v1.17.* |
kube-install v0.4.* | kube-install-for-k8s1.18-v0.4.*.tgz | Install kubernetes v1.18.* |
kube-install v0.4.* | kube-install-for-k8s1.19-v0.4.*.tgz | Install kubernetes v1.19.* |
kube-install v0.4.* | kube-install-for-k8s1.20-v0.4.*.tgz | Install kubernetes v1.20.* |
kube-install v0.4.* | kube-install-for-k8s1.21-v0.4.*.tgz | Install kubernetes v1.21.* |
Note: for a list of supported operating system distributions, please refer to OS support list.
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 Address | Role | OS Version | Root Password |
192.168.1.11 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.12 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.13 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.14 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
You can download the `kube-install-*.tgz` package from https://github.com/cloudnativer/kube-install/releases.
If you want to install version 1.18 of kubernetes, download the kube-install-v1.18.tgz
package file.If you want to install version 1.17 of kubernetes, download the kube-install-v1.17.tgz
package file.If you want to install version 1.16 of kubernetes, download the kube-install-v1.16.tgz
package file...In the same way, you can download the version you want.
For example, we are now installing kubernetes v1.21, and we have downloaded the kube-install-for-k8s1.21-v0.4.2.tgz
package.
# cd /root/
# wget https://github.com/cloudnativer/kube-install/releases/download/v0.4.2/kube-install-for-k8s1.21-v0.4.2.tgz
# tar -zxvf kube-install-for-k8s1.21-v0.4.2.tgz
# cd /root/kube-install/
Please operate in the root user environment. Perform the system environment initialization operation on the k8s-master selected above:
# cd /root/kube-install/
# ./kube-install -opt init
Please operate in the root user environment. Execute on the k8s-master selected above:
# cd /root/kube-install/
# ./kube-install -opt install -master "192.168.1.11,192.168.1.12,192.168.1.13" -mastervip "192.168.1.88" -node "192.168.1.11,192.168.1.12,192.168.1.13,192.168.1.14" -sshpwd "cloudnativer"
Note: in the above command, the -mastervip
parameter is the kubernetes cluster virtual IP address.So you need to assign the kubernetes cluster a virtual IP address on the same LAN as the k8s-master.
Execute the following command on the k8s-master you selected to view the kube-dashboard console URL and key:
# cat /opt/kube-install/loginkey.txt
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:
After kube-install is installed, you can directly execute `kube-install` command in any directory of any k8s-master server.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 Address | Role | OS Version | Root Password |
192.168.1.11 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.12 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.13 | k8s-master,k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.14 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.15 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
192.168.1.16 | k8s-node | CentOS Linux release 7 or Red Hat Enterprise Linux(RHEL) 7 | cloudnativer |
Select any k8s-master server, and execute the following command on it:
# kube-install -opt addnode -node "192.168.1.15,192.168.1.16" -sshpwd "cloudnativer"
The architecture after installation is shown in the following figure:
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.
The parameters about kube-install can be viewed using the `kube-install help` command. You can also see more detailed parameter introduction here.