Skip to main content

Kubernetes Architecture

 

Understanding Kubernetes Architecture: A Comprehensive Overview

Introduction to Kubernetes

Kubernetes, often stylized as K8s, is an open-source platform designed to automate deploying, scaling, and operating application containers. Developed by Google and now maintained by the Cloud Native Computing Foundation, Kubernetes has become the de facto standard for container orchestration. It is designed to handle the deployment and management of containerized applications across a cluster of machines, providing tools for deploying applications, scaling them as necessary, managing changes to existing containerized applications, and helping optimize the use of underlying hardware beneath your containers.




Key Components of Kubernetes Architecture

Kubernetes follows a client-server architecture. Here’s an overview of the main components involved in its architecture:

1. Control Plane (Master Node)

The control plane's components make global decisions about the cluster (for example, scheduling), as well as detecting and responding to cluster events (for example, starting up a new pod when a deployment's replicas field is unsatisfied).

  • API Server (kube-apiserver): Acts as the front end to the control plane. The API server is the only Kubernetes component that connects with the cluster's shared state (etcd), allowing users, management tools, and other components to interact with the cluster.
  • etcd: A consistent and highly-available key value store used as Kubernetes’ backing store for all cluster data.
  • Scheduler (kube-scheduler): Watches for newly created pods with no assigned node, and selects a node for them to run on.
  • Controller Manager (kube-controller-manager): Runs controller processes which regulate the state of the cluster, managing the lifecycle of different resources like nodes, namespaces, and persistent storage.
  • Cloud Controller Manager (cloud-controller-manager): Lets you link your cluster into your cloud provider’s API, and separates out the components that interact with that cloud platform from components that just interact with your cluster.

2. Node (Worker Node)

Nodes are the workers that run your applications. Each node includes the services necessary to run pods and is managed by the master components. They include:

  • Kubelet: An agent that runs on each node in the cluster. It ensures that containers are running in a pod.
  • Kube-proxy: Maintains network rules on nodes. These network rules allow network communication to your pods from network sessions inside or outside of your cluster.
  • Container Runtime: The software that is responsible for running containers. Kubernetes supports several container runtimes: Docker, containerd, CRI-O, and any implementation of the Kubernetes CRI (Container Runtime Interface).

3. Add-ons

These are components and services that support additional features and functionalities in Kubernetes:

  • DNS: Every Kubernetes cluster should have DNS as all Kubernetes services are discovered through DNS.
  • Web UI (Dashboard): Kubernetes Dashboard is a general-purpose, web-based UI for Kubernetes clusters.
  • Container Resource Monitoring: Provides central storage for containers' time-series metrics and provides data for Kubernetes built-in horizontal pod auto-scaling.
  • Cluster-Level Logging: Mechanisms for saving logs from containers, which can help in debugging or security compliance monitoring.

How Kubernetes Works

Here’s a simplified workflow in Kubernetes:

  1. Deployment: When you deploy applications on Kubernetes, you tell the cluster to start the desired containers. The API server takes your commands and communicates them to the appropriate components to get the containers started.
  2. Scheduling: The scheduler watches for requests from the API server for new containers and assigns them to nodes.
  3. Execution: Each node has a Kubelet, which instructs the node’s container runtime to start the container(s).
  4. Service Discovery and Load Balancing: Kubernetes gives containers their own IP addresses and a single DNS name for a set of containers, which can do load-balancing between them.
  5. Storage Orchestration: Kubernetes allows you to automatically mount a storage system of your choice, whether from local storage, a public cloud provider, or a network storage system.
  6. Self-healing: Kubernetes restarts containers that fail, replaces containers, kills containers that don't respond to your user-defined health check, and doesn't advertise them to clients until they are ready to serve.

Comments

Popular posts from this blog

DevOps Vs DevSecOps

   DevOps and DevSecOps are two methodologies that have gained traction in the IT industry for streamlining software development and deployment. However, their approach to security and operations differs, making each suitable for different types of projects and organizational needs. Let's explore DevOps versus DevSecOps with a real-time example, focusing on their distinctions, integration, and practical applications. DevOps: The Foundation DevOps is a cultural and professional movement that emphasizes collaboration and communication between software developers and other IT professionals while automating the process of software delivery and infrastructure changes. It aims to shorten the development life cycle and provide continuous delivery with high software quality. Core Principles: Continuous Integration and Continuous Deployment (CI/CD): Automate building, testing, and deployment of applications. Collaboration: Breaking down silos between teams (developers, IT operations...

Deploying a Node.js project to Azure App Services using Azure DevOps pipelines

Deploying a Node.js project to Azure App Services using Azure DevOps pipelines is a robust way to automate deployment processes and integrate continuous integration and deployment (CI/CD) practices into your workflow. This guide will walk you through the setup of an Azure DevOps pipeline to deploy a Node.js application from GitHub or Azure Repos to Azure App Services. Prerequisites Before you begin, ensure you have the following: An Azure account. You can sign up for a free account here . A GitHub or Azure Repos account with your Node.js project. An Azure DevOps account. Create one here if you don't have it. Step 1: Prepare Your Node.js Application Make sure your Node.js application is ready and includes a package.json file in the root. This file is crucial as it contains dependency information and scripts needed for your application. Step 2: Create an Azure Web App Log into Azure Portal: Visit https://portal.azure.com . Create a Web App: Click on "Create a resource". ...

Git Cheat Sheet

  Git Cheat Sheet Category Command Description Setup git config --global user.name "[name]" Set a name that will be attached to your commits and tags. git config --global user.email "[email]" Set an email that will be attached to your commits and tags. git init Initialize a new git repository in the current directory. git clone [url] Clone a repository into a new directory. Stage & Snapshot git status Show modified files in the working directory, staged for your next commit. git add [file] Add a file as it looks now to your next commit (stage). git reset [file] Unstage a file while retaining the changes in the working directory. git diff Show diff of what is changed but not staged. git diff --staged Diff of what is staged but not yet committed. git commit -m "[message]" Commit your staged content as a new commit snapshot. Branch & Merge git branch List all of the branches in your repo. git branch [name] Create a new branch at the current commit. gi...