Install Kubernetes Kubedam on Ubuntu

Sumon PaulSumon Paul
4 min read

How to Install kubeadm on a 2-Node Ubuntu Setup Using a Shell Script

Kubernetes is an open-source container orchestration tool that helps deploy, scale, and manage containerized applications. Google initially designed Kubernetes and is now maintained by the Cloud Native Computing Foundation. With Kubernetes, you can freely make use of the hybrid, on-premise, and public cloud infrastructure to run deployment tasks of your project.

Kubernetes works with Docker, Containerd, and CRI-O currently.

We can run Kubernetes locally using the below methods:

  • Minikube: A single-node Kubernetes cluster for development and testing

  • Kubeadm: A multi-node Kubernetes cluster

Here, we will see how to deploy a multi-node Kubernetes cluster using the

This Guidebook Provides Step-by-Step Instructions for Installing Kubernetes on Ubuntu 22.04.xx

Before you begin

  • 2 or more Linux servers running Ubuntu 22.04

  • root privileges

  • 3.75 GB or more of Ram - for better performance, use 6 GB

  • 2 CPUs or more

  • Full network connectivity between all machines in the cluster (public or private network is fine)

  • Unique hostname, MAC address, and product_uuid for every node.

  • Certain ports are open on your machines.

Step 1:

Settings up Static IP and Hostname and FQDN for (Master-Worker) Node

rm -rf install-kubeadm
git clone https://github.com/SumonPaul18/install-kubeadm.git
chmod -R +x install-kubeadm
. install-kubeadm/iphostname.sh

Step 2:

Install-Kubernetes-Kubeadm-on-Ubuntu for (Master-Worker) Node

rm -rf install-kubeadm
git clone https://github.com/SumonPaul18/install-kubeadm.git
chmod -R +x install-kubeadm
. install-kubeadm/install-kubeadm-ubuntu.sh

Bellow Step Going on Master Node

Step 3:

Configure as Kubeadm Master Node (Master)

rm -rf install-kubeadm
git clone https://github.com/SumonPaul18/install-kubeadm.git
chmod -R +x install-kubeadm
. install-kubeadm/kubeadm-master.sh
Go to be Manually Installation












Step 4 - Joining worker node with Kubernetes Cluster

Comming Code...!

This Step perform on Worker Node for Joining with k8s Cluster

Copy the kubeadm join token & Paste on Worker Node

kubeadm join 172.30.20.20:6443 — token cdm6fo.dhbrxyleqe5suy6e \
— discovery-token-ca-cert-hash sha256:1fc51686afd16c46102c018acb71ef9537c1226e331840e7d401630b96298e7d

Verify from Master Node

kubectl get nodes
kubectl get nodes -o wide

The system should display the worker nodes that you joined to the cluster.

Check cluster status:

kubectl cluster-info

Step 5 - Test Kubernetes Cluster (From Master Node)

To test Kubernetes installation, let’s try to deploy nginx based application and try to access it.

kubectl create deployment mynginx --image=nginx --replicas=2

Check the status of nginx-app deployment

kubectl get deployment mynginx

Expose the deployment as NodePort

kubectl expose deployment mynginx --type=NodePort --port=80

Run following commands to view service status

kubectl get svc mynginx
kubectl describe svc mynginx

Use following curl command to access nginx based application,

curl http://<woker-node-ip-addres>:31246

Quick Tip: For beginners who still have no experience of deploying multiple containers, Minikube is a great way to start.

Conclusion

After following the steps mentioned in this article carefully, you should now have Kubernetes installed on Ubuntu. Kubernetes allows you to launch and manage Docker containers across multiple servers in the pod.

In this article, we have explained the installation of the Kubernetes container management system on Ubuntu 20.04. Kubernetes has a lot of functionality and features to offer. The Kubernetes Official Documentation is the best place to learn.

If you have any questions about installing

0
Subscribe to my newsletter

Read articles from Sumon Paul directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Sumon Paul
Sumon Paul