How to Install Kubernetes on CentOS/RHEL k8s: Part-4

0
212
views
How to Install Kubernetes on CentOS/RHEL k8s: Part-4

Now from the previous article, we have complete section1 for setting up Kubernetes cluster. In section 1 we have installed all the component and packages which were required to set up on both the worker node and master node.

We will be continuing our section 2 and section 3 in this article to complete our Kubernetes cluster. For those who have not completed section1 please follow this link to complete section 1 before continuing section 2:

How to Install Kubernetes on CentOS/RHEL

Before continuing section 2, I would like to mention about pod network. There are several pod network plugin available for communication between pods which is called by Kubernetes. Kubernetes supports the CNI – the Container Network Interface.

Following are few solutions which provide plugins for Kubernetes (listed alphabetically):

  • Calico
  • Flannel
  • Open vSwitch (OVS)
  • Romana
  • Weave
  • You can also write your own.

For this installation, I m going to use calico pod network. Well, you may use any of the pod network plugins to continue with the installation.

Section 2: Command to Run on Master Node only

Step 1: Initiate Kubernetes cluster

To initiate the pod network we need to run following command. In this comment, we will tell the kubernetes cluster to use pod network cidr and API server IP. As here I am initializing kubernetes cluster with calico pod network.

This will take some time don’t worry after getting this complete, there are some important information keep it for further use like below
And keep kubeadm join command for future reference which will be used for joining your worker node.
kapendra.com_kubernets_install_successNow run the command as instructed from the result of the previous command.

Keep this for further use:

Step 2: Bring UP the Pod (calico or flannel)

After kuberenets cluster initialization, we need to bring up the pod network so that our pods can communicate with each other.

kapendra.com_kubernets_install_calico

Test your calico pod network deployment.

kapendra.com_kubernets_install_all_pods
Bring Up the DashBoard

kapendra.com_kubernets_install_dashboard

Here comes the end of section 2 now we will run the last section i.e section3. In this section, we will run our command only on worker nodes.

Section 3: Command to Run on Worker Node only

Part 1: Join Node
Now run join command which we got after initialization of kubernetes cluster in section 2
On both

On Node 1

On Node 2

This Completes the installation process by joining our nodes. we can also verify that our nodes have joined kubernetes cluster by running on the master

In the next article, we will learn to set up minikube, a single node kubernetes setup for development and learning objective

Kubernetes Series Links:

Understanding Kubernetes Concepts RHEL/CentOs K8s Part-1
Understanding Kubernetes Concepts RHEL/CentOs k8s: Part-2
How to Install Kubernetes on CentOS/RHEL k8s?: Part-3
How to Install Kubernetes on CentOS/RHEL k8s?: Part-4
How To Bring Up The Kubernetes Dashboard? K8s-Part: 5
How to Run Kubernetes Cluster locally (minikube)? K8s – Part: 6
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 7
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 8
How To Handle Minikube(Cheatsheet)-3? K8s – Part: 9