Kubernetes

Kubernetes

Kubernetes Clusters, Nodes and Pods to Deploy Scaled Services

☁️ Kubernetes clusters, nodes and pods to deploy services and devops with scalable infrastructure and microservices in the cloud.

Kubernetes

Kubernetes


☁️ Kubernetes is an open-source platform designed to automate the deployment, scaling, and management of containerized applications.
Kubernetes is often abbreviated as K8s.
That technology was originated at Google in 2014 and has since become the industry standard for container orchestration, currently used in AWS, Google Cloud Plattform and Azure.

What is Kubernetes?


🌐 What is Kubernetes?
Kubernetes is the de facto standard for container orchestration, enabling organizations to run applications reliably at scale across diverse environments. While powerful, it requires careful planning, skilled teams, and robust infrastructure to unlock its full potential.
Definition of Kubernetes: It is a portable, extensible system for managing containerized workloads and services.
Abbreviation: K8s.
The name Kubernetes originates from Greek, meaning "helmsman" or "pilot".
History: Google open-sourced Kubernetes in 2014, leveraging over 15 years of experience running large-scale production workloads.

Kubernetes Benefits


Benefits of using Kubernetes.
Kubernetes solves these by acting as the orchestrator—the “brain” that ensures applications run reliably and efficiently.
🚀 Why Kubernetes Matters
Containers revolutionized application packaging, but running them at scale introduced challenges:
- Scalability: Managing thousands of containers across clusters. Automates scaling applications up or down based on demand.
- Resilience: Recovering from node or container failures automatically.
- Self-Healing: Automatically restarts failed containers, replaces and reschedules them when nodes die, and kills containers that don't respond to user-defined health checks.
- Zero Downtime: Rolling updates without service interruption.
- Multi-Cloud Flexibility: Running workloads across different environments.
- Portability: Runs on public clouds (AWS, Azure, Google Cloud), on-premises, or hybrid environments.

️ Core Concepts


⚙ Core Concepts of Kubernetes:
- Cluster: A set of machines (nodes) running Kubernetes.
- Node: A worker machine (physical or virtual) that runs pods.
- Pod: The smallest deployable unit, usually containing one or more containers.
- Deployment: Defines how pods are created, scaled, and updated.
- Service: Provides stable networking and load balancing for pods.
- etcd: A distributed key-value store that holds cluster state.
- Controller: Continuously reconciles the actual state with the desired state defined in YAML manifests.

🔑 Key Features of Kubernetes


🧩 ️ Key Features
- Declarative Configuration: Define desired state in YAML/JSON files.
- Self-Healing: Restarts failed containers, reschedules pods, replaces nodes.
- Horizontal Scaling: Automatically adds/removes pods based on demand.
- Service Discovery & Load Balancing: Routes traffic to the right pods.
- Automated Rollouts/Rollbacks: Deploy new versions safely.
- Multi-Cloud & Hybrid Support: Runs on AWS, Azure, GCP, on-premises, or hybrid setups.

Kubernetes Challenges


⚠️ Some Considerations and Challenges in this automation technology:
- Complexity: Steep learning curve for beginners.
- Resource Overhead: Requires significant compute/memory for control plane.
- Security: Misconfigured clusters can expose sensitive workloads.
- Operational Expertise: Best suited for teams with DevOps maturity.

Kubernetes Compared


📊 Compare Kubernetes vs. Alternatives:
Feature; Kubernetes; Docker Swarm; OpenShift
Scalability; Very high, production-grade; Moderate; High, enterprise-focused
Community; Large, global; Smaller; Red Hat-driven
Flexibility; Works across clouds; Limited; Strong enterprise integration
Learning Curve; Steep; Easier; Moderate

Kubernetes with Minikube


🛠️ Guide to set up Kubernetes locally using Minikube to experiment with it hands-on.

You can set up Kubernetes locally to get hands-on experience without needing a full cloud environment.
You have a few popular options depending on your goals and system resources:

Installing Kubernetes with Minikube is Beginner-Friendly.
Minikube runs a single-node Kubernetes cluster inside a VM or container on your local machine.
Steps:
- Install prerequisites:
- Virtualization software (Docker, VirtualBox, or Hyper-V).
- kubectl (Kubernetes command-line tool).
- Minikube binary.
- Start Minikube:
minikube start
- Verify cluster:
kubectl get nodes
- Deploy a sample app:
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
- Access the app:
minikube service hello-node

Kubernetes in Docker


🖥️ You can install Kubernetes in Docker and kind.
Kind is lightweight and runs Kubernetes clusters inside Docker containers. Perfect for testing CI/CD pipelines.
Steps:
- Install Docker.
- Install kind:
go install sigs.k8s.io/kind@latest
- or download binaries.
- Create a cluster:
kind create cluster
- Use kubectl:
kubectl cluster-info --context kind-kind

️ MicroK8s


💻 You can run Kubernetes locally with MicroK8s (Canonical’s lightweight Kubernetes).
MicroK8s is a snap-based distribution, great for Linux users.
Steps:
- Install MicroK8s:
sudo snap install microk8s --classic
- Add user to group:
sudo usermod -a -G microk8s $USER
- Check status:
microk8s status --wait-ready
- Enable add-ons (like DNS, dashboard):
microk8s enable dns dashboard

Kubernetes in Windows


There are several options to run Kubernetes in Windows:
⚖️ Which Should You Choose?
- Minikube → Best for beginners, easy setup, GUI dashboard available.
- kind → Best for developers testing CI/CD pipelines.
- MicroK8s → Best for Linux users who want a lightweight but production-grade local cluster.

Installing Kubernetes locally on Windows


👉 Guide to install Kubernetes locally on Windows using Minikube.
You can also install Kubernetes on a Windows machine with different options.
Minikube is the most beginner-friendly option.

🛠️ Step 1: Install Prerequisites
- Enable Virtualization
- Make sure virtualization is enabled in your BIOS (Intel VT-x or AMD-V).
- You can check by opening Task Manager → Performance → CPU; look for “Virtualization: Enabled.”
- Install a Hypervisor or Docker
- Options: Hyper-V (built into Windows Pro/Enterprise), VirtualBox, or Docker Desktop.
- If you already use Docker Desktop, Minikube can run directly inside it.
- Install kubectl (Kubernetes CLI)
- Download from the official Kubernetes release page.
- Add it to your system PATH so you can run kubectl from any terminal.

Install Minikube


🛠️ Step 2: Install Minikube
- Download Minikube for Windows from the official release page.
- Add Minikube to your PATH (so you can run it from PowerShell or Command Prompt).
- Verify installation:
minikube version

🛠️ Step 3: Start Your Cluster
Run:
minikube start --driver=docker

or replace docker with hyperv or virtualbox depending on your setup.

🛠️ Step 4: Verify Cluster
Check that your node is running:
kubectl get nodes

🛠️ Step 5: Deploy a Sample App
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-node --type=LoadBalancer --port=8080

🛠️ Step 6: Access the App
minikube service hello-node

This will open a browser window showing your running app.

✅ Tips to facilitate minikube management of clusters and nodes.
- Use minikube dashboard to launch a web UI for managing your cluster.
- If you want multiple clusters, you can run:
minikube start -p mycluster

Kubernetes setup from Windows PowerShell


Steps to install in Windows PowerShell script. so you can copy-paste commands directly without worrying about manual setup.

You can use Windows PowerShell script to install and set up Minikube with Kubernetes locally on your Windows machine.
You can copy-paste this into PowerShell (run as Administrator):
# Step 1: Install Chocolatey (if not already installed)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Step 2: Install kubectl (Kubernetes CLI)
choco install kubernetes-cli -y

# Step 3: Install Minikube
choco install minikube -y

# Step 4: Verify installations
kubectl version --client
minikube version

# Step 5: Start Minikube cluster (using Docker driver by default)
minikube start --driver=docker

# Step 6: Verify cluster is running
kubectl get nodes

# Step 7: Deploy a sample app
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-node --type=LoadBalancer --port=8080

# Step 8: Access the app
minikube service hello-node

# Optional: Launch Kubernetes Dashboard
minikube dashboard

🔑 Notes:
- This script uses Chocolatey (Windows package manager) to simplify installation.
- If you don’t have Docker Desktop installed, Minikube can also use Hyper-V or VirtualBox as the driver. Replace --driver=docker with --driver=hyperv or --driver=virtualbox.
- Run PowerShell as Administrator to avoid permission issues.

Hyper-V


This is a Hyper-V specific version of the script, in case you prefer using Windows’ built-in virtualization instead of Docker.

Hyper-V

Here’s a Windows PowerShell script tailored for running Minikube with Hyper-V as the driver. This assumes you’re on Windows Pro/Enterprise (since Hyper-V isn’t available on Home edition):
# Step 1: Enable Hyper-V (requires restart)
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

# Step 2: Install Chocolatey (if not already installed)
Set-ExecutionPolicy Bypass -Scope Process -Force
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Step 3: Install kubectl (Kubernetes CLI)
choco install kubernetes-cli -y

# Step 4: Install Minikube
choco install minikube -y

# Step 5: Verify installations
kubectl version --client
minikube version

# Step 6: Create a Hyper-V virtual switch (only once)
# Replace "MinikubeSwitch" with your preferred name
New-VMSwitch -Name "MinikubeSwitch" -SwitchType Internal

# Step 7: Start Minikube cluster using Hyper-V driver
minikube start --driver=hyperv --hyperv-virtual-switch "MinikubeSwitch"

# Step 8: Verify cluster is running
kubectl get nodes

# Step 9: Deploy a sample app
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
kubectl expose deployment hello-node --type=LoadBalancer --port=8080

# Step 10: Access the app
minikube service hello-node

# Optional: Launch Kubernetes Dashboard
minikube dashboard


🔑 Notes
- Restart required after enabling Hyper-V.
- The virtual switch is essential—Minikube needs it to connect networking between your VM and host.
- Run PowerShell as Administrator for all commands.
- If you already have a Hyper-V switch, you can skip Step 6 and just reference its name in Step 7.


️ Kubernetes Troubleshooting


Troubleshooting checklist of common errors like “Hyper-V switch not found” or “VT-x disabled” so you’ll know how to fix issues quickly if setup doesn’t go smoothly.
Here’s a troubleshooting checklist for setting up Minikube with Hyper-V on Windows. These are the most common issues and fixes you’ll encounter:

⚠️ Common Issues & Fixes
1. Hyper-V not enabled
- Symptom: minikube start fails with driver errors.
- Fix: Run PowerShell as Administrator:
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All


- Restart your computer afterward.
2. Virtualization disabled in BIOS- Symptom: Error messages about VT-x/AMD-V not available.
- Fix:
- Reboot into BIOS/UEFI.
- Enable Intel VT-x or AMD-V under CPU/Advanced settings.
- Save and restart.
3. Hyper-V switch not found- Symptom: Error: Hyper-V virtual switch not found.
- Fix: Create a new internal switch:
New-VMSwitch -Name "MinikubeSwitch" -SwitchType Internal
- Then restart Minikube with:
minikube start --driver=hyperv --hyperv-virtual-switch "MinikubeSwitch"
4. Insufficient memory or CPU- Symptom: Cluster fails to start, VM crashes.
- Fix: Allocate more resources:
minikube start --driver=hyperv --memory=4096 --cpus=2
5. Networking issues (no internet in VM)- Symptom: Pods fail to pull images.
- Fix:
- Ensure the Hyper-V switch is connected to your host network adapter.
- Run:
Get-NetAdapter
- Then bind the switch to the correct adapter.
6. kubectl not recognized- Symptom: kubectl command not found.
- Fix:
- Verify installation with:
choco install kubernetes-cli -y
- Add C:\ProgramData\chocolatey\bin to your PATH if needed.
7. Dashboard not opening- Symptom: minikube dashboard hangs or fails.
- Fix:
- Run:
minikube dashboard --url
- Copy the URL into your browser manually.
✅ Quick Health Check Commands- Verify Minikube status:
minikube status
- Check nodes:
kubectl get nodes
- Check pods:
kubectl get pods --all-namespaces
You can also prepare a step-by-step recovery script (PowerShell commands you can run in sequence) that automatically fixes the most common Hyper-V issues, so you don’t have to troubleshoot manually each time.

Kubernetes Components


Kubernetes Key Concepts and Components
Clusters & Nodes: A Kubernetes cluster consists of a control plane (manages the cluster) and worker nodes (run the applications).
Pods: The smallest deployable units, containing one or more containers.
Service Discovery & Load Balancing:
Kubernetes exposes containers using its own IP address or a single DNS name, balancing traffic automatically.
Automated Rollouts/Rollbacks: Allows defining desired states for containers and changing the actual state to the desired state at a controlled rate.

This section explains the key components of a Kubernetes cluster, such as the control plane and worker nodes.

Why Kubernetes


Why Kubernetes (K8s)
It is the industry-standard tool for managing complex, microservices-based applications.

Origin: Built upon 15+ years of experience running production workloads at Google, it was open-sourced in 2014 and is now maintained by the Cloud Native Computing Foundation (CNCF).
Adoption: Used widely by enterprises to avoid cloud vendor lock-in and manage complex application deployments at scale.
What Is Kubernetes?
Kubernetes is an open-source platform that can automate the management, deployment, and scale of containerized applications. Discover more about Kubernetes, including its architecture, features, and uses.
Complete Kubernetes: An Easy and Practical Guide - Complete...
Google, for example, deploys more than 12 billion applications monthly based on Kubernetes. Well-known services such as Search, YouTube, Gmail, Google Play, Chrome, among others. ChatGPT .

Kubernetes Documentation


Kubernetes is an open source container orchestration engine.
Kubernetes (K8s) is an open-source platform that automates the deployment, scaling, and management of containerized applications. It acts as a container orchestrator, managing clusters of virtual machines to handle application networking, storage, and self-healing. K8s ensures high availability and efficient resource usage in cloud, hybrid, or on-premises environments. Originally developed by Google.
Find more information in:
Kubernetes Official Website
Kubernetes is a production-grade container orchestration, portable and extensible.
Kubernetes in Google Cloud
Kubernetes in Azure
The Kubernetes command-line tool, kubectl, allows you to run commands from the console.
AWS Kubernetes Cluster Management. Simplify On-Premises Kubernetes Management with Amazon EKS Anywhere, AWS Migration Solutions, AWS App Discovery. Automate Cluster Management in Amazon Web Services.
Kubernetes is an open source container orchestration platform that automates deployment, management and scaling of applications.

Is Kubernetes easier than Docker?
There are some differences in complexity and learning curve.
Kubernetes requires a higher level of complexity compared to running Docker containers locally.
Kubernetes requires concepts like pods, nodes, services, deployments, and namespaces require time to master. For teams new to container orchestration, setting up a cluster and configuring resources can be overwhelming.
What is Kubernetes? Kubernetes is an open source container orchestration platform that automates many of the manual processes involved in deploying, managing, and scaling ...
CKA Certified Kubernetes Administrator with practice Tests
What exactly does Kubernetes do?
Kubernetes helps you to build cloud-native microservices-based apps. It also supports containerization of existing apps, thereby becoming the foundation of application modernization and letting you develop apps faster.
Kubernetes Explained and Hands On with Videos

Kubernetes is an open-source system for automating the deployment, management, and scaling of containerized applications.
Kubernetes automates deployment, scaling, & management of containerized apps. It uses a control plane & worker nodes
Learn Kubernetes - Full Course with Real-World Examples from freeCodeCamp.org
Kubernetes Explained and k8s Architecture

Kubernetes Control Plane


Kubernetes is an orchestator of containers to scale services.
It is based on Control Plane and Worker Nodes.
Control Plane : API Server, Scheduller, Controller Manager, etcd
Worker Node : Pot1, Pot2, Pot3 with different containers each

Control Plane : interconnect trought Rest API to provide services to (UI / CLI)
API Server : Is center of communications of worker nodes and control Plane (Scheduller, Controller Manager, etcd)

Node1 : Pod1 (eth0), veth0 / virtual bridge / kube-proxy / iptables/IPVS/eth0 = Cluster Network (with other nodes)

Cluster Example :
Namespace / Name / Target PORT / URL
default myservice1 8080 http://192.168.1.3:3223
default myservice2 8081 http://192.168.3.3:3366

It works using a reverse proxy routing rules with a load balancer.

# Example with kind:
kind : ConfigMap / metadata / database_uri / keys
ReplicationController / ngix/ replicas 4
Deployment : as a webserver / ngix

# Headless service
# Replica data replication
# Features : Self Healing / Automatic Rollback / Horizontal Scaling
# Requires many nodes for replication

# Examples : Amazon EKS / Azure AKS / GKE (Google Kubernetes Engine)

# Service Manager to deploy clusteres
etcd key value store
kubelet kube-proxy

# --- kubectl CLI Commands
kubectl get nodes
kubectl get pods -A

# Kubernetes deployments in YAML
ngix-deployment.yaml

cd Desktop
sudo vi ngix-deployment.yaml

kubectl apply -f ngix-deployment.yaml

kubectl get deployments --all-namespaces

# change and appy and changes the total of pods (replicas)

# Lens Desktop Kubernetes provides a nice UI

.Net Applications in Kubernetes


Kubernetes can run ASPX and .NET applications, but they must be containerized first.
ASP.NET (including legacy ASPX Web Forms) and modern .NET Core/ASP.NET Core apps can be packaged into Docker images and deployed to Kubernetes clusters.

🛠 How It Works
- Containerization:
- Legacy ASPX apps (ASP.NET Framework) run on Windows-based containers.
- Modern ASP.NET Core apps run on Linux or Windows containers.
- You create a Dockerfile using Microsoft’s official base images (mcr.microsoft.com/dotnet/aspnet for runtime, mcr.microsoft.com/dotnet/sdk for build).
- Deployment:
- Once containerized, the app is deployed as a Pod in Kubernetes.
- You define Deployments for scaling, Services for networking, and optionally Ingress Controllers for routing external traffic.
- Scaling & Management:
- Kubernetes handles autoscaling, load balancing, and self-healing (restarting failed pods).
- Configurations and secrets are managed via ConfigMaps and Secrets.

⚖️ Comparison: ASPX vs ASP.NET Core on Kubernetes
Feature | ASPX (ASP.NET Framework) | ASP.NET Core (.NET 6/7/8)
Container Type | Windows-only | Linux or Windows
Performance | Heavier, slower startup | Lightweight, faster startup
Cloud-Native Support | Limited | Full support
Best Use Case | Legacy migration | Modern microservices
Ease of Deployment | More complex (Windows nodes required) | Easier, widely supported



🚀 Migration Options
- Azure Kubernetes Service (AKS): Microsoft provides tools like Azure Migrate: App Containerization to package existing ASPX apps without modifying code.
- Google Cloud GKE / AWS EKS: Both support running .NET apps in containers, with autoscaling and monitoring features.

⚠️ Challenges & Considerations
- Legacy ASPX apps: Require Windows Server Core containers, which are heavier and less portable than Linux containers.
- State management: ASPX apps often rely on session state; Kubernetes encourages stateless design, so external session storage (Redis, SQL Server) may be needed.
- Networking: ASPX apps may need adjustments for reverse proxies and ingress controllers.
- Licensing: Windows containers may have licensing implications compared to Linux-based deployments.

✅ Bottom Line:
Kubernetes can run both ASPX and modern .NET apps. For new projects, use ASP.NET Core with Linux containers for simplicity and scalability.
For legacy ASPX apps, containerization with Windows-based images is possible, but expect more complexity and resource overhead.
You can create a Dockerfile and Kubernetes manifest example for running an ASPX app versus an ASP.NET Core app.
Technology Kubernetes 2026
How the Kubernetes Groundswell is Revolutionizing Enterprise Infrastructure Management TechCrunch
AI complexity reshapes modern infrastructure SiliconANGLE
Deploying Disaggregated LLM Inference Workloads on Kubernetes | NVIDIA Technical Blog NVIDIA Developer
Announcing Oracle AI Database Operator for Kubernetes v2.1.0 Oracle Blogs