Skip to main content

Command Palette

Search for a command to run...

Kubernetes Overview and Architecture

Navigating the Kubernetes Galaxy 🛰️

Published
6 min read
A

👩‍💻 Hey there! I'm a DevOps engineer and a tech enthusiast with a passion for sharing knowledge and experiences in the ever-evolving world of software development and infrastructure. As a tech blogger, I love exploring the latest trends and best practices in DevOps, automation, cloud technologies, and continuous integration/delivery. Join me on my blog as I delve into real-world scenarios, offer practical tips, and unravel the complexities of creating seamless software pipelines. Let's build a strong community of tech enthusiasts together and embrace the transformative power of DevOps!

🌐 Kubernetes Overview

With the widespread adoption of containers among organizations, Kubernetes, the container-centric management software, has become a standard for deploying and operating containerized applications and is one of the most important parts of DevOps.

Originally developed at Google and released as open-source in 2014. Kubernetes builds on 15 years of running Google's containerized workloads and the valuable contributions from the open-source community. Inspired by Google’s internal cluster management system, Borg.

🤔 What is Kubernetes?

Kubernetes, often abbreviated as K8s, is an open-source container orchestration platform for automating the deployment, scaling, and management of containerized applications. Containers are a lightweight form of virtualization that packages an application and its dependencies into a single, consistent unit. Kubernetes provides a framework for automating the management of these containers at scale, making it easier to deploy and manage complex applications in dynamic and distributed environments.

Why do we call it K8s?

The abbreviation "K8s" for Kubernetes is a shorthand notation that is commonly used to represent the full name while saving space and making it easier to type or pronounce. The "K8" portion of the abbreviation represents the eight letters between the 'K' and the 's' in "Kubernetes."

This abbreviation is often used informally in discussions, documentation, and command-line tools as a convenient way to refer to Kubernetes without having to type out the full name each time.

🌟 Benefits of Kubernetes

Kubernetes offers several key benefits for containerized application orchestration and management:

🔹Automated Deployment: Kubernetes automates the deployment process, making it easy to roll out applications consistently and predictably across different environments.

🔹Scalability: It allows for horizontal and vertical scaling of applications, automatically adjusting resources to meet demand, which helps with high availability and efficient resource utilization.

🔹Load Balancing: Kubernetes provides built-in load balancing for distributing traffic to application instances, improving reliability and performance.

🔹Self-Healing: Kubernetes can automatically detect and replace failed containers or nodes, ensuring that applications remain available and resilient.

🔹Rolling Updates and Rollbacks: It simplifies the process of updating applications with minimal downtime and supports easy rollbacks if issues arise during updates.

🔹Portability: Kubernetes works across various cloud providers and on-premises environments, promoting application portability and reducing vendor lock-in.

🔹Declarative Configuration: You define the desired state of your application, and Kubernetes takes care of maintaining that state, reducing manual intervention.

🔹Ecosystem and Extensibility: Kubernetes has a rich ecosystem of extensions and plugins, enabling you to integrate with various tools and services for monitoring, logging, security, and more.

🔹Community and Support: Kubernetes has a large and active community, which means you can find ample resources, documentation, and support from the community and vendors.

🔹Cost Efficiency: By optimizing resource usage and scaling based on demand, Kubernetes can help reduce infrastructure costs.

🔹Security: Kubernetes offers built-in security features like role-based access control (RBAC), network policies, and secrets management to help protect your applications.

🔹Multi-Tenancy: It supports multi-tenancy through namespaces, allowing you to create isolated environments within a single cluster.

🔹Continuous Integration and Continuous Deployment (CI/CD): Kubernetes integrates well with CI/CD pipelines, enabling automated testing and deployment of applications.

🔹Stateful Applications: Kubernetes supports stateful applications through features like StatefulSets, making it suitable for a wide range of workloads, notjust stateless applications.

🏗️ Kubernetes Architecture

Kubernetes has a multi-layered architecture that consists of various components, each with its specific role in orchestrating and managing containerized applications. Here's an overview of the key architectural components in Kubernetes:

🖥️ Master Node

The master node, also known as the control plane is a core component of a Kubernetes cluster's architecture. It is responsible for managing and maintaining the overall state and configuration of the cluster. The control plane serves as the brain of the Kubernetes cluster, making high-level decisions about scheduling, scaling, and maintaining applications.

The master node components typically include:

  • 📡 API Server: The API server is the central control plane component that acts as the entry point for all administrative and management tasks. It exposes the Kubernetes API, which allows users, controllers, and other components to interact with the cluster. It validates and processes API requests.

  • 🗂️ etcd: etcd is a distributed key-value store that stores all cluster data, including configuration settings, cluster state, and metadata. It serves as the cluster's source of truth and provides data consistency and high availability.

  • 🎛️ Controller Manager: This component manages various controller processes responsible for maintaining the desired state of the cluster. Controllers, such as the Replication Controller and StatefulSet Controller, monitor and control the number of pod replicas and other resources.

  • 📆 Scheduler: The scheduler assigns work (i.e., scheduling pods) to worker nodes based on resource requirements, affinity/anti-affinity rules, and other policies. It aims to distribute work evenly across the cluster while considering node capacity and constraints.

  • ☁️ Cloud Controller Manager (optional): In cloud-based Kubernetes deployments, this component interacts with the cloud provider's APIs to manage external resources like load balancers and storage.

🖥️ Node (Worker Node)

A worker node, also known as a minion node, is a fundamental component in the architecture of a Kubernetes cluster. Worker nodes are responsible for running the actual containerized applications, also known as pods, and providing the computing resources required for those pods to operate. In contrast to the control plane, which manages the cluster's control and management functions, worker nodes handle the workload and application execution.

Here are the key components and responsibilities of a worker node:

  • 🏃‍♂️ Kubelet: The Kubelet is an agent running on each worker node. It communicates with the API server and ensures that containers are running in pods as specified in the cluster's desired state. It manages the container lifecycle, including starting, stopping, and monitoring containers.

  • 🐋 Container Runtime: Kubernetes supports various container runtimes, such as Docker, containerd, and CRI-O, to run containers within pods.

  • 🔄 Kube Proxy: Kube Proxy is responsible for network proxying and load balancing on a node. It maintains network rules to enable communication to and from pods. It helps implement the Kubernetes service abstraction.

  • 📦 Pod: A pod is the smallest deployable unit in Kubernetes, representing one or more containers that share the same network namespace and storage volume. Containers within a pod can communicate with each other using localhost.

🧾 Add-Ons

  • Kubernetes clusters often include additional components and add-ons to enhance functionality and address specific use cases. Some common add-ons include the DNS service (for service discovery), the Dashboard (a web-based UI), and monitoring/logging solutions like Prometheus and Fluentd.

  • 🌐Ingress Controller (optional):

    • Ingress controllers manage external access to services within the cluster. They handle tasks like SSL/TLS termination, routing based on URL paths, and load balancing for incoming traffic. Popular ingress controllers include Nginx Ingress and Traefik.
  • 💾Storage (optional):

    • Kubernetes supports various storage options, including Persistent Volumes (PVs) and Persistent Volume Claims (PVCs), to provide storage for stateful applications. Storage solutions can vary depending on the cluster's environment and requirements.
  • 🔌Networking:

    • Kubernetes networking involves the setup of network policies, service networking, and communication between pods across nodes. Network plugins like Calico, Flannel, and Cilium help manage networking configurations.

The overall architecture of Kubernetes is designed for high availability, scalability, and flexibility. It abstracts away the underlying infrastructure, allowing for consistent management and orchestration of containerized applications across diverse environments, whether on-premises, in the cloud, or in hybrid setups. Each component plays a crucial role in maintaining the desired state of the cluster and ensuring the reliability and availability of applications.

More from this blog

DevOps & AWS Essentials

38 posts