Setup Multi Node Kubernetes Cluster

all settings must be same.

2. Provide atleast 2gb ram to the OS.

3. Click on next and follow up the default installation settings till create.

4. Settings >Storage > Select the iso file from the location.

you should have the iso file downloaded on your system of rhel8.

5. Select start and begin the installlation (Select ‘minimal install’ in software selection).

6. After installation complete. Do the following changes :

Now we are good to go.

NOTE: We need some programs to run on the OS, like “Container-Engine”, here we are going to use “docker-ce”, kubelet, and some other prerequisites . These programs are required in master node as well as slave node, so to save our time we will setup all the programs in one OS and then clone the others with the similar settings.

yum install net-tools vim httpd

In my case software's are already installed.

yum install docker-ce — nobest (put two hyphen before nobest).

In my case it is already installed.

Note:

systemctl stop firewalld

systemctl disable firewalld

vi /etc/rc.d/rc.local

type “chmod +x /etc/rc.d/rc.local” after making the changes in file.
Type the following command to install the above softwares.
Type “vi /etc/selinux/config” and make the above changes.

systemctl start docker

systemctl enable docker

Note: We need to change the CGroup Driver to “systemd” in redhat 8 to manage everything properly.

follow the above steps to apply the “systemd” driver .
working perfectly
Type “vi /etc/fstab” and comment the last line to disable the swap services to run kubelet .
“sysctl — system” to set the configuration.

systemctl start kubelet

systemctl enable kubelet

services will start when master node will connect..
simply clone the OS . In my case I Cloned one master node and two slave nodes, shown above.
similarly do for the slave nodes.
Type “vi /etc/hosts” and save the changes. Do the same updation in other nodes as well and then try pinging to each node to check the connectivity.
— pod-network-cidr will set the desired range of the pods.
after completion, we can check the kubectl services.
Copy the same command and apply on other nodes as well to connect .

Here I use “Flannel” Overlay Network Provider.

Apply the command with the link to provide the overlay network.
Copy the config file (contains the certifications and other files required to connect to the cluster from client source) to the windows desktop in any folder.
cluster connects to client successfully.

One Short Example to show the use-case of Multi-Node Kubernetes Cluster:

Launch a ReplicaSet with 3 replicas using httpd image .
Here we can check that two pods are created in slave2 and one pod in slave1 and we launch the replica-set from master node . So this is one short example of multi-node Kubernetes cluster.

We can verify where the pods are running by manually checking the nodes.

We can verify from above snap the management of multi node cluster.
“ NodePort service is exposed “
Finally IP is exposed to the client and displays the result .

Thank You !

For any query feel free to contact me anytime on my LinkedIn Profile :

https://www.linkedin.com/in/mayank-varshney-62744a163

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
MAYANK VARSHNEY

MAYANK VARSHNEY

3 Followers

I am a forward-thinking individual with exceptional skills in problem-solving, adaptive thinking, automation, and development.