← Back to Blog

πŸš€ Day 1: Introduction to Kubernetes πŸš€

πŸš€ 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.

πŸš€ 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:


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