Member-only story
Kubernetes cluster creation using Kubekey
“Gratitude is an abstraction in life that creates Happiness. All we have to do is, use it more often and save the time we spend searching for happiness…”
Creating and setting up a Kubernetes cluster in the native way is often not straightforward. The administrator usually uses kubeadm to set up and bootstrap the cluster. It involves multiple steps to install and configure. I had covered the steps in my below previous article — https://medium.com/geekculture/a-step-by-step-demo-on-kubernetes-cluster-creation-f183823c0411
I recently came across Kubekey, which is a product of a project called KubeShpere — a distributed operating system for cloud native applications using kubernetes as its kernel. Learn more about Kubesphere — Here.
It adds a level of abstraction for k8s cluster creation. We can create k8s cluster with a single command, passing the cluster node details in a yaml file as an argument. It eases the life of cluster administrator in a lot more ways than just cluster creation. We are going to discuss its features in this article and share my experience while using this tool.
Installation of kubekey binary is pretty straightforward as below.
root@asish-lab:~/lab/kubekey# curl -sfL https://get-kk.kubesphere.io | VERSION=v1.2.1 sh -Downloading kubekey v1.2.1 from https://github.com/kubesphere/kubekey/releases/download/v1.2.1/kubekey-v1.2.1-linux-amd64.tar.gz ...Kubekey v1.2.1 Download Complete!root@asish-lab:~/lab/kubekey# ls -ltr
total 23112
-rw-r--r-- 1 1001 121 24468 Dec 17 06:44 README_zh-CN.md
-rw-r--r-- 1 1001 121 24539 Dec 17 06:44 README.md
-rwxr-xr-x 1 1001 121 11970124 Dec 17 06:46 kk
-rw-r--r-- 1 root root 11640487 Jan 2 02:39 kubekey-v1.2.1-linux-amd64.tar.gz
First lets check the supported k8s versions in kubekey. We can use only the k8s versions. ( I wish there were more. )
root@asish-lab:~/lab/kubekey# ./kk version --show-supported-k8s
v1.15.12
v1.16.8
v1.16.10
v1.16.12
v1.16.13
v1.17.0
v1.17.4
v1.17.5
v1.17.6
v1.17.7
v1.17.8
v1.17.9
v1.18.3
v1.18.5
v1.18.6
v1.18.8
v1.19.0
v1.19.8
v1.19.9
v1.20.4
v1.20.6
v1.20.10
v1.21.4
v1.21.5
v1.22.1