Tuesday, March 18, 2025

🖥️ Installing Kubernetes – Setting up Minikube, K3s, and Kubernetes Clusters

 

Installing Kubernetes – Setting up Minikube, K3s, and Kubernetes Clusters

Before you can start using Kubernetes, you need to set up a Kubernetes cluster. In this guide, we’ll walk through different installation methods, including Minikube, K3s, and full Kubernetes clusters.


🌍 Shape Your Future with AI & Infinite Knowledge...!!

🌐 Want to Generate Text-to-Voice, Images & Videos? 👉 http://www.ai.skyinfinitetech.com 📚 Read In-Depth Tech & Self-Improvement Blogs 👉 http://www.skyinfinitetech.com ▶ Watch Life-Changing Videos on YouTube 👉 https://www.youtube.com/@SkyInfinite-Learning 🔥 Transform Your Skills, Business & Productivity – Join Us Today! 🔥



📌 Choosing the Right Kubernetes Installation

Depending on your use case, you can choose from the following:

Minikube – Best for beginners and local development.
K3s – Lightweight Kubernetes for edge computing and IoT.
Full Kubernetes Cluster – For production deployments on cloud or on-premises.


🚀 Installing Kubernetes with Minikube (For Local Development)

Minikube is a tool that lets you run a single-node Kubernetes cluster locally.

🔹 Prerequisites

  • Virtualization enabled (for VirtualBox, Hyper-V, or Docker)
  • kubectl (Kubernetes CLI) installed


🔹 Installation Steps

1️⃣ Download and Install Minikube


curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 sudo install minikube-linux-amd64 /usr/local/bin/minikube


2️⃣ Start Minikube Cluster


minikube start


3️⃣ Check the Cluster Status


kubectl get nodes


4️⃣ Deploy an Application on Minikube


kubectl create deployment nginx --image=nginx


5️⃣ Expose the Application


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


Installing Kubernetes with K3s (Lightweight Kubernetes)

K3s is a lightweight Kubernetes distribution designed for edge computing, IoT, and low-resource environments.

🔹 Installation Steps

1️⃣ Run the following command to install K3s


curl -sfL https://get.k3s.io | sh -


2️⃣ Check the Cluster Status


kubectl get nodes


3️⃣ Deploy an Application on K3s


kubectl create deployment myapp --image=nginx


🏗️ Installing a Full Kubernetes Cluster (For Production)

For production environments, you need a full-fledged Kubernetes setup with multiple nodes. This can be done using:

kubeadm – The official Kubernetes cluster setup tool.
Managed Kubernetes Services – Like AWS EKS, Azure AKS, and Google GKE.

🔹 Installing Kubernetes with kubeadm

1️⃣ Install Docker & Kubernetes Components


sudo apt update sudo apt install -y docker.io curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main" sudo apt install -y kubelet kubeadm kubectl


2️⃣ Initialize the Kubernetes Cluster


sudo kubeadm init


3️⃣ Set Up kubectl for the Admin User


mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config


4️⃣ Join Worker Nodes to the Cluster
Run the join command generated by kubeadm init on other nodes.


5️⃣ Verify the Cluster is Running


kubectl get nodes


🎯 Which Installation Method Should You Use?

Installation MethodBest For
MinikubeLocal development & learning Kubernetes
K3sLightweight setups (IoT, Edge computing)
kubeadmOn-premises or self-managed production clusters
Cloud-managed KubernetesEnterprise & scalable cloud-native workloads

📢 Next Up: Kubernetes Architecture – Understanding Nodes, Pods, Services, and Deployments!

No comments:

Post a Comment

Terraform State Deep Dive: Why it's Crucial and How to Manage It

Terraform State Deep Dive: Why it's Crucial and How to Manage It ...