Kubernetes - Growing the cluster with Centos 7 node
In my previous post we seen how to install and configure kubernetes master node and dashboard on Ubuntu 18.04. Now this post is about growing the Kubernetes master by joining more nodes. For this setup i am going to use a Centos 7 VM running in virtualbox.
Installation
Fist update the centos with all latest packages
Install docker and enable in startup
Now add the kubernetes repository to yum configuration
Disable selinux. For permanant disable edit the file “/etc/sysconfig/selinux”  otherwise the kube-flannel-xxx will goes to crashloop in next reboot.
After that install kubernetes packages and enable in startup.
Add the host entry for name resolution
Disable swap
Till this step everything is same as we did in kubernetes master, except the difference of centos 7 operation system.
Adding nodes to the cluster
Now join the node to the kubernetes master using the join command. We already seen in the previous post how to get the token and hash in case you didn’t note it during master installation.
Check if the flannel interface is created and should have the pod network ip 40.168.x.x
Since cluster and authentication keys(~/.kube/config) not configured in secondary nodes(drona-child-3) we cannot run kubectl get nodes in secondary.
We have to do all the orchestration activity from the master node. I am connecting to the master node and checking the nodes status
Creating deployment in kubernetes cluster
Let try deploying a pod. I am using nginx server. The below command will automatically pull the nginx image from the docker hub and deploy it as pod.
Now we can see the deployment “nginx” is created.
To see more details about the deployment , use the describe command
Scaling the pods
Now let scale the pod to 3 replica
List the pods and verify it.
Now delete one of the pod and see if it is automatically scaling up to 3
Discussion and feedback