Header Ad Section

Introduction to Kubernetes (K8s)




Introduction

Kubernetes, also simply referred as K8s is an open-source container orchestration platform that originally developed by Google and currently is maintained by the Cloud Native Computing Foundation (CNCF)It primarily aids in the automation (management) of the deployment, scaling, and operation of containerized applications. By handling complex tasks like self-healing, load balancing, and rolling updates, it guarantees that they operate reliably in different environments . This allows us to improve or use the resource efficiency.


Why Do We Use Kubernetes?

As you all know that with the rise of microservices, containerized technologies became essential for deploying/hosting independent applications. However, managing these kind of hundreds or thousands of containers by hand across multiple environments may be unmanageable (very hard to manage) with scripts or automated tools. So, that's why container orchestration technologies like Kubernetes came in to the place.


What Kubernetes Solves:

  1. High Availability – This ensures there is no downtime (zero downtime) by automatically managing failures (Self Healing) by monitoring the health of pods and nodes.

  2. Scalability – This ensures that it dynamically adjusts the application resources based on workload demands.

  3. Disaster Recovery – It provides built-in mechanisms for data backup and recovery such as restore applications and data after unexpected failures or outages.


Kubernetes (K8s) Architecture

Kubernetes follows a Master-Slave Architecture, consisting of following mentioned key concepts.

1. Master Node (Control Plane)

Here the Master Node is the responsible component for managing the entire cluster. It mainly consists of following items.

  • API Server - This is the entry point for the cluster, facilitating communication via UI, API, and CLI.

  • Controller Manager -Its responsibility is to monitor the cluster and ensures that applications are running as expected.

  • Scheduler - Its responsibility is assigning the workloads to worker nodes based on the available resources.

  • etcd (Key-Value Store) - Its responsibility is to store the cluster state and the configuration data.

  • Virtual Network - Its responsibility is to enable the communication between master and worker nodes.

Note: Please not that in production environments, there may be at least two master nodes which are recommended to prevent single points of failure.


2. Worker Nodes

Worker nodes execute the actual workloads and contain:

  • Kubelet - It is a critical agent that runs on every worker node in a Kubernetes cluster and also responsible for maintaining communication between the worker node and the control plane.

  • Containers - These are lightweight, standalone units that package an application together with all its required dependencies, libraries, and runtime configurations.

  • Pods - It is considered as the smallest deployable and maintainable unit in Kubernetes.



Key Concepts of Kubernetes

1. Pods

  • Pods are considered as the fundamental building blocks of Kubernetes and it represents the smallest deployable unit.
  • Each worker node hosts multiple pods, and also each pod contains one or more containers.
  • Every pod is assigned a unique IP address, enabling internal communication between its containers.
  • Kubernetes does not manage individual containers; instead, it manages pods.
  • If a container within a pod fails, Kubernetes automatically restarts it.
  • Pods are ephemeral, meaning they can be frequently terminated and recreated.

2. Services

  • Services act as stable endpoints for pods, ensuring communication remains seamless even when pods restart and receive new IPs.

  • Services provide:
    • Permanent IP Address - This eliminates dependency on dynamic pod IPs.
    • Load Balancing - This distributes traffic across multiple pods for better availability.

3. Containers

  • Containers are packaged units of applications.
  • Kubernetes deploys and manages them within pods, ensuring scalability, security, and fault tolerance.

Post a Comment

0 Comments