It's for a long time that I haven't use K8s, and now I realize it's necessary to understand more and practice more about K8s.
    Now, We'll try to establish a POC for K8s with CentOS 8 under virsh Env.
    Actually, 1st I tried to use Fedora 32 for host to deploy K8s installation. And soon I found there's always error when tried to use kubeadm command to deploy the master/worker nodes. Searching articles about F32 and I realize that F32 use cgroup v2 but K8s' latest version still build under cgroup v1 and that made the deployment failed.
    After using CentOS 8 , the issue of deployment failure didn't happpen anymore.     In the pre-condition, we need to setup each virtual host to a fixed IP address, whatever using static IP or MAC-bounded IPv4 address is all right. And make sure disable SELinux and firewall daemon.
    Then, we need to install docker-CE and the latest K8s version:


	# dnf config-manager --add-repo=
    # dnf install --> so far there's no pkg for CentOS8 so that we use previous vertion.
    # dnf install docker-ce

Enable the Docker:

    # systemctl enable docker;systemctl start docker

Instasll kubeadm to the master node:

	# cat < /etc/yum.repos.d/kubernetes.repo
    # dnf install kubeadm -y
    # systemctl enable kubelet; systemctl start kubelet
    BTW, turnoff the SWAP space in every K8s node:
# swapoff -a

Initial the kubeadm:

	#	kubeadm init
If everything goes well, you should found a command after initialization:
 "kubeadm join [IP of master node]:6443 --token nu06lu.xrsux0ss0ixtnms5 –discovery token-ca-cert-hash sha256:f996ea35r4353d342fdea2997a1cf8caeddafd6d4360d606dbc82314683478hjmf7"
Please take care that every initialization should get different CA cert, just make sure there should be a command with "kubeadm join" start so that we could use the commands to join new node into the master node.
     After adding all nodes, we could use:
	# kubectl get nodes
The command help us understand current all nodes' condition.
    Now, we need to copy some file to our root directory:
# mkdir -p $HOME/.kube
# cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
# chown $(id -u):$(id -g) $HOME/.kube/config
Before adding nodes, we need to create a POD network.In the example, I choose flannel network:
# kubectl apply -f
More detail please refer to here.     Then, go to the other nodes that we'd like to add into the cluster and issue the command as above. Please be aware that we have to make sure all nodes knows each other so that we have to establish DNS service or add name records in /etc/hosts for every nodes.
Then we could issue the command:
# kubeadm join [IP of master node]:6443 --token nu06lu.xrsux0ss0ixtnms5 –discovery token-ca-cert-hash sha256:f996ea35r4353d342fdea2997a1cf8caeddafd6d4360d606dbc82314683478hjmf7
And then go to the master node to issue get node command to make sure all nodes could be found.


source 1 source 2