In this blog, we will show you the Steps to install kubernetes cluster manually using CENTOS 7.
3 Virtual Machine with an internet connection.
Please check the URL https://www.assistanz.com/google-kubernetes-overview-and-architecture/ to know more about the kubernetes basics and it’s architecture.
We are creating two node cluster for this demo.
The Master IP will be 192.168.3.81.
Node 1 IP will be 192.68.3.82 and Node 2 IP will be 192.168.3.83.
We are using the Flannel Network for the POD communication in this demo.
Log in to the master server and we have already set the hostname as k8s-master during OS installation.
Disable the SELinux using the below commands.
Add the below entries in the conf file to change the Linux host bridge values and save the changes.
Disable the SWAP by adding the # symbol at the beginning and save the changes.
Restart the VM using the command init 6 to apply the SELinux and SWAP changes.
Once the VM is back to online, open the host file.
Add the below entries in the host file and save the changes.
Create a new file named kubernetes.repo under yum.repos.d folder using the below command.
Add the below entries and save the changes.
Now, Install the docker and kubeadm using the below command.
It will take few minutes to complete the installation.
Enable and start the docker and kubelet services using commands.
We have already set the hostname for node1 and node2 during OS installation.
Please follow the above master server configuration steps for the kubernetes node preparation. We have already installed the docker and kubeadm on both the nodes.
We are using the Flannel network for this demo.
To make the flannel to working properly, we need to specify the network CIDR while configuring the cluster. Use the below command to create a cluster.
It will take few minutes to complete the configuration process.
Kubernetes cluster has configured successfully.
Execute the below commands below start using the cluster.
Also, make a note of the kubeadm join command to add the nodes into the cluster.
We can list the available system PODS using the below command.
Kube-DNS will be in pending state until we install the POD network for the cluster.
Use the below command to install the Flannel network.
The flannel pod will start initiating and it will take few minutes to complete the configuration process.
We can get the detailed information about a POD using describe option.
After some time, all the system pods are in running state.
From the node1 use the kubeadm join command to add the nodes into the cluster.
Node has been joined into the cluster successfully.
From the master server, type the below command to list the available nodes in the cluster.
We can use the same kubeadm join command to add more nodes in future.
In case if you forget to make a note of kubeadm join information, use the below command from the master server to retrieve the join information.
Thanks for reading this blog. We hope it was useful for you to learn about installing kubernetes manually on CENTOS 7.
Logeswaran holds Microsoft certified engineer & solution architect certifications with over 11+ years of experience in the fields of hosting technologies and IMS/Cloud consulting. At AssistanZ, Logeswaran spearheads the strategic planning and execution of the company’s Microsoft based core technologies to Enterprise clients.
Which version of kubernetes has been installed in your environment?
We have tested in kubernetes 1.9.3 and its working fine.
Thanks for your comment. We can deploy the application using the labels. Please check our other blogs to know about the labels functionality in kubernetes environment.
I am getting this error. Please help me out!
Warning FailedScheduling 4m (x12 over 6m) default-scheduler 0/1 nodes are available: 1 node(s) were not ready.
How to assing a external IP to an existing network using ingress.