Day 35: Kubernetes

Day 35: Kubernetes

Exploring Kubernetes Fundamentals

Introduction

In today's captivating live session by Shubham Londhe, we took a peak into the foundational aspects of Kubernetes, a powerful container orchestration platform. Our learning journey encompassed critical concepts like autoscaling, auto healing, and the intricate architecture that forms the backbone of Kubernetes. Let's take a brief journey through these topics and unravel the core ideas behind them.

Kubernetes

Empowering Container Orchestration: Kubernetes, often abbreviated as K8s developed by Google, is an open-source container orchestration platform that facilitates the management and deployment of containerized applications at scale. It offers a comprehensive framework for automating application deployment, scaling, and management.

Key features of Kubernetes

  1. Container Orchestration: Kubernetes automates deployment, scaling, and management of containerized applications, streamlining operations.

  2. Automated Scaling: It dynamically adjusts the number of pods based on workload, ensuring optimal resource utilization and performance.

  3. Self-Healing: Kubernetes detects failures and automatically replaces or reschedules pods and nodes, enhancing application reliability.

  4. Service Discovery & Load Balancing: It simplifies service discovery and evenly distributes traffic to maintain high availability and efficient load management.

Kubernetes Architecture

Mastering the Components: The architecture of Kubernetes is structured to provide a scalable and reliable platform for managing containerized applications. The master node and worker nodes collaborate to maintain the desired application state. Key components include:

  1. Master Node:

    • API Server: Acts as the control center, exposing the Kubernetes API and processing incoming requests.

    • Controller Manager: Ensures the desired state of the system by managing controllers responsible for various tasks like replication, endpoints, and nodes.

    • Scheduler: Assigns pods to nodes based on resource availability and user-defined constraints.

    • etcd: A distributed key-value store that maintains configuration data and the current state of the entire cluster.

  2. Worker Node:

    • Kubelet: Communicates with the API server, manages pods, and ensures they maintain the desired state.

    • Service Proxy (kube-proxy): Facilitates network communication either between Pods or from external clients to Pods. It helps in routing the network traffic appropriately.

    • Container Runtime: This is the software used to run containers. Docker is commonly used, but other runtimes like containerd can also be used.

Minikube Installation

Pre-requisites

  • Ubuntu OS (Xenial or later)

  • sudo privileges

  • Internet access

  • t2.medium instance type or higher in AWS EC2

  1. Installation: Open a terminal and run the following commands one by one, either on the local machine or on the EC2 instance:
sudo apt-get update
sudo apt install -y curl wget apt-transport-https
sudo apt install -y docker.io

sudo systemctl start docker
sudo systemctl enable docker

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

Make Minikube executable: Modify permissions of minikube and move to the filepath:

chmod +x minikube
sudo mv minikube /usr/local/bin/

Kubectl Installation: Download Kubectl using the below link:

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

Make Kubectl executable: Modify permissions of Kubectl and move to the filepath:

chmod +x kubectl
sudo mv kubectl /usr/local/bin/

Start Minikube: Now, you can start Minikube with the following command:

minikube status
kubectl get nodes

Status: Check the cluster status with the below command:

minikube status
kubectl get nodes

Stop Minikube: When you are done, you can stop the Minikube cluster with:

minikube stop

Delete Cluster: If you wish to delete the Minikube cluster entirely, you can do so with:

minikube delete
Note
Remember that Minikube is meant for local development and testing, and not for production use. Enjoy experimenting with Kubernetes on your Ubuntu machine!

Conclusion:

Today's session provided a captivating introduction to Kubernetes, uncovering the fundamentals of autoscaling, auto-healing, and the underlying architecture. With Kubernetes at the helm, the world of container orchestration becomes a realm of automated efficiency, scalability, and resilience. As we continue on this learning journey, we're better equipped to harness the power of Kubernetes for deploying and managing applications in a dynamic and complex digital landscape.

Hope you like my post. Don't forget to like, comment, and share.