π Day 1: Introduction to Kubernetes π
π
π Morning Session: π
-
Overview of Containerization and Kubernetes
In the first part of the session, we discussed how containers isolate applications and their dependencies. This is key for making Kubernetes the de facto standard for container orchestration. -
Key Concepts: Pods, Nodes, Clusters, Services, Namespaces
We went over the critical building blocks of Kubernetes. Pods are the smallest deployable units, Nodes are the physical or virtual machines, and Clusters represent a group of Nodes running containers. We also touched on Services (how Pods communicate) and Namespaces (isolated environments within a cluster). -
Kubernetes Architecture
We reviewed how the Kubernetes Control Plane manages the desired state of the cluster, including etcd, Scheduler, and Controller Manager.
π Afternoon Session: π
-
Setting up a Kubernetes Environment on Windows π₯οΈ
Time to get hands-on! For this session, weβll be working on setting up a Minikube cluster on a Windows environment. -
Installing Minikube π οΈ
Step 1: Install Chocolatey, the Windows package manager, to install Minikube and other dependencies:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Step 2: Install Minikube using Chocolatey:
choco install minikube -y
- Setting up kubectl π»
Step 1: Install kubectl, the Kubernetes command-line tool:
choco install kubernetes-cli -y
Step 2: Verify the installation by checking the kubectl version:
kubectl version --client
- Hands-on: Deploying a Simple Application π
Letβs deploy a simple Hello World application.
Step 1: Start Minikube:
minikube start
Step 2: Create a simple deployment with kubectl:
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
Step 3: Expose the application via a Kubernetes service:
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
Step 4: Get the Minikube IP and port to access the app:
minikube service hello-node --url
π Now you can open your browser and see the Hello World app running!
πΈ Screenshot of the Process πΈ
Hereβs a screenshot of the environment set up on Windows with the deployment running successfully:
π Key Takeaways π
-
Kubernetes is a powerful container orchestration system.
-
Minikube is an excellent tool to run Kubernetes locally on Windows.
-
With the kubectl CLI, you can easily manage deployments and services.
-
This hands-on setup introduces you to real-world Kubernetes usage.
π‘ What I Want to Achieve:
Through this blog, youβve now learned how to set up a Kubernetes cluster locally using Minikube on a Windows environment and deploy a simple Hello World application.
π Connect with me:
-
πΌ LinkedIn: https://www.linkedin.com/in/rifaterdemsahin/
-
π¦ Twitter: https://x.com/rifaterdemsahin
-
π₯ YouTube: https://www.youtube.com/@RifatErdemSahin
-
π» GitHub: https://github.com/rifaterdemsahin
Feel free to use this post in your WordPress blog! Let me know if you need further assistance or additional details! π
RANCHER VERSION
Here's a version adapted for a Rancher Desktop environment:
π Kubernetes Quickstart on Rancher Desktop π
π Morning Session: π
Introduction to Containerization and Kubernetes
In this part, we covered how containers package applications with their dependencies, leading to Kubernetes being the standard for orchestrating containers.
Key Concepts:
-
Pods: Smallest deployable units.
-
Nodes: Physical or virtual machines running Pods.
-
Clusters: Groups of Nodes.
-
Services: Allow communication between Pods.
-
Namespaces: Isolated environments in a cluster.
Kubernetes Architecture Overview
We reviewed how the Control Plane manages the cluster state with components like etcd, Scheduler, and Controller Manager.
π Afternoon Session: π
Setting up Kubernetes on Rancher Desktop (Windows/Mac/Linux) π₯οΈ
Rancher Desktop is a great alternative to Minikube for setting up a local Kubernetes environment. Letβs dive into how to get this setup running.
Step 1: Download and install Rancher Desktop
-
Download Rancher Desktop from here.
-
Install it on your machine and choose the Kubernetes runtime.
Step 2: Configure kubectl
Rancher Desktop automatically installs and configures kubectl, the Kubernetes command-line tool.
- Verify the installation:
kubectl version --client
Step 3: Start Rancher Desktop and check Kubernetes status
-
Launch Rancher Desktop, and Kubernetes will start automatically.
-
To confirm everything is working, run:
kubectl get nodes
Hands-on: Deploy a Simple Application π
Now, letβs deploy a simple "Hello World" app with Rancher Desktop.
Step 1: Create a deployment
kubectl create deployment hello-node --image=k8s.gcr.io/echoserver:1.4
Step 2: Expose the application via a service
kubectl expose deployment hello-node --type=LoadBalancer --port=8080
Step 3: Retrieve the service URL
kubectl get svc
Or use the Rancher Desktop UI to find the service details.
Step 4: Access the application in your browser
Use the IP and port from the service output or the Rancher Desktop dashboard.
π Congratulations! You've successfully deployed a Kubernetes application using Rancher Desktop!
π Key Takeaways:
-
Rancher Desktop simplifies local Kubernetes setups with easy configuration.
-
kubectl is the command-line tool for managing your Kubernetes cluster.
-
Running Kubernetes locally is an excellent way to experiment with real-world use cases.
π‘ Through this blog, youβve learned how to set up Kubernetes locally with Rancher Desktop and deploy a simple application. Happy containerizing!
π Connect with me:
πΌ LinkedIn: Rifat Erdem Sahin
π¦ Twitter: @rifaterdemsahin
π₯ YouTube: RifatErdemSahin
π» GitHub: rifaterdemsahin
Feel free to use this post for your WordPress blog! Let me know if you need further help! π
Imported from rifaterdemsahin.com Β· 2024