🦉
Programming Notes
  • My Programming Notes
  • CKA Exam Preparation
    • Certified Kubernetes Administrator
    • Setup Minikube
    • Network Design Principles
    • Role-Based Access Control (RBAC)
    • Namespace
    • Resource Quota
    • Pod
    • Deployment
    • Deployment: Rollout
    • ConfigMap
    • Service
    • Service: kubectl expose
    • Pod: Resources Management
    • Pod & Container: Quality of Service Class
    • Pod & Container: Probes
    • Limit Range
    • Scaling: Manual
    • Scaling: Horizontal Pod Autoscaler
    • Persistent Volume & Claim
    • Secret
    • Ingress: Routing
    • Ingress: TLS
    • Ingress: Rate Limit
    • Ingress: Basic Auth
    • Ingress: CRD (Custom Resource Definition)
    • Job
    • CronJob
    • Mutli-Node Cluster
  • Golang
    • Generics
    • Context
    • Goroutines and Channels in Go
    • Goroutine: Concurrency vs Parallelism
    • Goroutine: Performance & Tradeoffs
    • JSON: omitzero
  • Rust
    • Arrays & Slices
    • Closures
    • Generics & Traits
    • Iterators
    • Run Code Simultaneously
    • String vs &str
    • Tests
    • Rustlings Exercises
      • Variables
      • Functions
      • If
      • Primitive Types
      • Vectors
      • Move Semantics
      • Structs
      • Enums and Matching Pattern
      • Strings
      • Modules
      • Hashmaps
      • Options
      • Error Handling
      • Generics
      • Traits
      • Lifetimes
      • Tests
      • Iterators
      • Smart Pointers
      • Threads
      • Macros
      • Quiz 1
      • Quiz 2
      • Quiz 3
  • Software Engineering
    • CAP Theorem
    • Circuit Breaker
    • Decoupling
    • GraphQL: Query Caching
    • HMAC Signature
    • Idempotency
    • Monolith VS Microservice
    • OWASP Top 10 2021
    • PCI DSS
    • PostgreSQL: Partitioning
    • PostgreSQL: Replication
    • Protobuf & gRPC
    • Redis: Streams
    • Resource Scaling
    • Signed URL
    • SOLID
    • Stack VS Heap
    • Stateful VS Stateless
  • Site Reliability Engineering
    • Chaos Engineering
    • Distributed Tracing
    • Kubernetes (k8s)
    • SLA, SLO, and SLI Metrics
    • Site Reliability Engineer
  • Others
    • FFMPEG Cheat sheet
Powered by GitBook
On this page
  • Key Features
  • Why Kubernetes?
  • Core Components of Kubernetes
  • Master Node (Control Plane)
  • Worker Nodes
  • Pods
  • Services
  • Ingress
  • ConfigMaps and Secrets
  • Persistent Volumes and Persistent Volume Claims
  • Kubernetes in the Real World
  1. Site Reliability Engineering

Kubernetes (k8s)

Kubernetes (often abbreviated as K8s) is an open-source platform for automating the deployment, scaling, and management of containerized applications. It provides a robust framework for running distributed systems reliably and efficiently.

Key Features

  • Container Orchestration: Manages the lifecycle of containers, including scheduling, scaling, and deployment.

  • Self-Healing: Automatically restarts failed containers, replaces and reschedules containers when nodes fail, and kills containers that don't respond to user-defined health checks.

  • Horizontal Scaling: Dynamically scales applications up or down based on resource usage or other custom metrics.

  • Service Discovery and Load Balancing: Exposes services to the outside world and distributes traffic among healthy instances.

  • Automated Rollout and Rollback: Manages application updates while maintaining service continuity and enabling rollbacks if an update fails.

  • Storage Orchestration: Manages storage solutions, including local storage, cloud storage, and network-attached storage, and dynamically provisions volumes as needed.

  • Configuration Management: Manages application configuration using ConfigMaps and Secrets, separating configuration from application logic.

  • Multi-Cloud and On-Premises Support: Runs in various environments, from public clouds (AWS, GCP, Azure) to on-premises data centers.

Why Kubernetes?

Before Kubernetes, managing containers at scale was challenging. Tasks like container deployment, scaling, and network configuration required manual intervention or custom scripts. Kubernetes automates these tasks, providing benefits such as:

  • Improved Resource Utilization: Efficiently schedules workloads across available infrastructure.

  • High Availability: Ensures applications remain available even during failures.

  • Developer Productivity: Simplifies application deployment, enabling developers to focus on building features rather than infrastructure.

Core Components of Kubernetes

Master Node (Control Plane)

  • API Server: The central interface for managing Kubernetes resources via kubectl or other clients.

  • Scheduler: Assigns workloads (pods) to nodes based on resource availability and constraints.

  • Controller Manager: Monitors the state of the cluster and ensures it matches the desired state (e.g., managing replicas, nodes, etc.).

  • etcd: A distributed key-value store that stores cluster configuration data and state.

Worker Nodes

  • Kubelet: An agent that runs on each node to ensure containers are running as expected.

  • Kube-Proxy: Manages network rules for pod communication and service exposure.

  • Container Runtime: Software that runs and manages containers (e.g., Docker, containerd, CRI-O).

Pods

  • The smallest deployable unit in Kubernetes, representing one or more containers running together.

Services

  • Provide stable endpoints for accessing pods and manage load balancing.

Ingress

  • Manages external HTTP and HTTPS access to services.

ConfigMaps and Secrets

  • Store configuration and sensitive data, such as passwords and API keys, separately from application code.

Persistent Volumes and Persistent Volume Claims

  • Handle data persistence beyond the lifecycle of pods.

Kubernetes in the Real World

  • Microservices: Kubernetes is ideal for managing microservices architectures, enabling efficient scaling, service discovery, and updates for individual services.

  • Continuous Deployment: Integrated with CI/CD pipelines to automate deployments and rollbacks.

  • Hybrid and Multi-Cloud Deployments: Enables consistent deployments across different cloud providers and on-premises environments.

  • Big Data and Machine Learning: Used to manage compute resources for big data processing and ML model training.

PreviousDistributed TracingNextSLA, SLO, and SLI Metrics

Last updated 4 months ago