Kubernetes – Overview

By | 10/07/2024

In this post, we will see a brief overview of Kubernetes highlight the key components.
Kubernetes, often referred to as K8s, is an open-source platform that orchestrates the deployment, scaling, and management of containerized applications.
Born out of Google’s experience with running containers in production, Kubernetes has quickly become the gold standard for container orchestration, supported by major cloud providers.
Kubernetes abstracts the underlying hardware of nodes (servers) and offers a unified API to manage containerized workloads. This abstraction allows us to focus on application logic rather than worrying about the specifics of the underlying infrastructure, making it easier to deploy, scale, and operate applications consistently across on-premises, cloud, or hybrid environments.

Let’s see the key components of Kubernetes.
[CLUSTER]
A Kubernetes cluster is a set of nodes (machines) that run containerized applications. It consists of a master node and worker nodes. The master node manages the cluster, while the worker nodes run the applications.

  • Master Node: The control plane of a Kubernetes cluster, responsible for managing the state of the cluster and orchestrating the worker nodes. Key components include:
    • API Server: The front-end for the Kubernetes control plane, handling all API requests.
    • etcd: A consistent and highly available key-value store used for configuration and service discovery.
    • Scheduler: Assigns workloads to nodes based on resource availability.
    • Controller Manager: Runs controller processes to manage the state of the cluster, ensuring it matches the desired state.

  • Worker Nodes: These nodes run the containerized applications and are managed by the master node. Key components include:
    • Kubelet: An agent that runs on each node, ensuring containers are running as expected.
    • Container Runtime: Software that runs and manages containers, such as Docker or containerd.
    • Kube-proxy: Maintains network rules on nodes, enabling communication between services.


[PODS]
Pods are the smallest deployable units in Kubernetes, representing a single instance of an application.
A pod can contain one or more containers that share storage, network, and specifications for how to run. Pods are ephemeral by nature, with Kubernetes handling their creation, replacement, and termination.


[SERVICES]
Services provide a stable endpoint for a set of pods, abstracting the complexity of pod management. They enable load balancing and service discovery within the cluster. Key types of services include:

  • ClusterIP: Exposes the service on a cluster-internal IP.
  • NodePort: Exposes the service on each node’s IP at a static port.
  • LoadBalancer: Exposes the service externally using a cloud provider’s load balancer.


[VOLUMES]
Volumes in Kubernetes provide persistent storage to pods, outliving the lifecycle of individual containers. Common volume types include:

  • emptyDir: Temporary storage for the life of the pod.
  • hostPath: Maps a file or directory from the host node’s filesystem into the pod
  • PersistentVolume (PV) and PersistentVolumeClaim (PVC): Abstracts storage resources in the cluster and allows dynamic provisioning.


[NAMESPACES]

Namespaces provide a way to divide cluster resources between multiple users. They create isolated environments within the same physical cluster, making it possible to manage resources, policies, and quotas independently.


[CONTROLLERS]

Controllers are responsible for maintaining the desired state of the cluster by managing the lifecycle of pods and other resources. Key controllers include:

  • ReplicaSet: Ensures a specified number of pod replicas are running at any given time.
  • Deployment: Provides declarative updates for pods and ReplicaSets, allowing for rollouts and rollbacks.
  • StatefulSet: Manages stateful applications, ensuring stable network identities and persistent storage.
  • DaemonSet: Ensures a copy of a pod runs on all or selected nodes.
  • Job and CronJob: Manages batch and scheduled tasks, respectively



Kubernetes has become the go-to platform for container orchestration, offering numerous advantages that cater to the needs of modern application deployment and management. Here are some of the key benefits of using Kubernetes:

Scalability
Kubernetes excels at scaling applications both horizontally and vertically. With its powerful autoscaling capabilities, Kubernetes can automatically adjust the number of running containers based on real-time metrics such as CPU and memory usage. This ensures that your application can handle varying levels of traffic and workload without manual intervention.

Portability
Kubernetes provides a consistent platform for deploying applications across different environments, whether on-premises, in the cloud, or in hybrid setups. This portability simplifies the migration of workloads and ensures that applications behave consistently regardless of where they are deployed.

High Availability
Kubernetes is designed to ensure high availability of applications through its self-healing mechanisms and redundancy features. It automatically detects and replaces failed containers, ensuring that your application remains available and responsive.

Resource Efficiency
Kubernetes optimizes the use of computing resources through intelligent scheduling and bin-packing algorithms. It efficiently places containers on nodes based on resource requirements and availability, reducing wastage and maximizing resource utilization.

Self-Healing
Kubernetes continuously monitors the health of nodes and pods, automatically taking corrective actions when issues are detected. This self-healing capability ensures that your applications are always in the desired state, reducing downtime and the need for manual intervention.

Declarative Configuration
Kubernetes uses a declarative approach for configuration management, allowing you to describe the desired state of your applications and infrastructure using YAML or JSON files. This makes it easier to manage complex environments and ensures that your cluster’s state matches the defined configuration.


Kubernetes has fundamentally transformed the landscape of application deployment and management, offering a powerful, flexible, and scalable platform. By leveraging Kubernetes, organizations can enhance their operational efficiency, improve application reliability, and accelerate development cycles, all while maintaining consistency across diverse environments.
K8s official web site.


Leave a Reply

Your email address will not be published. Required fields are marked *