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 duty is to assign the workload to worker nodes according to available resources.

  • etcd (Key-Value Store) - Its duty is to store the state of the cluster and 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’s a core component that runs on all worker nodes in a Kubernetes cluster, and it’s also the communication channel between the worker node and the control plane.

  • Containers - These are lightweight and independent units that package an application with everything else required to execute it.

  • 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 runs one or more pods . Each pod runs one or more containers.
  • A unique IP address is assigned for each pod so containers can talk to each other within the pod.
  • Kubernetes does not manage single containers, it manages pods.
  • Kubernetes automatically restarts any container in a pod that fails.
  • Pods are ephemeral, meaning they can be killed and recreated frequently.

2. Services

  • Services offer stable endpoints for pods, facilitating communication even if the pods restart and receive new IPs.

  • Services provide:
    • Permanent IP Address - This eliminates dependency on dynamic pod IPs.
    • Load Balancing - Spreads traffic over multiple pods for improved availability.

3. Containers

  • Containers are packaged units of applications.
  • They are deployed and managed by Kubernetes in pods, so they are scalable, secure and fault tolerant.

Post a Comment

0 Comments