What is Kubernetes

This is a good intro

Notes: What is Kubernetes?

1. Definition

  • Kubernetes is an open-source container orchestration framework, originally developed by Google.
  • It manages applications composed of hundreds or thousands of containers across physical machines, virtual machines, cloud, or hybrid environments.

2. Why Kubernetes? (Problems it Solves)

  • Growth of microservices → led to widespread container usage.
  • Managing large numbers of containers manually is complex and often infeasible.
  • Kubernetes provides:
    • High availability – apps remain accessible with no downtime.
    • Scalability – ensures performance and responsiveness.
    • Disaster recovery – backups and restoration so no data is lost.

3. Kubernetes Architecture

  • Cluster Structure:
    • Master Node(s): Runs essential control processes.
      • API Server: Entry point for clients (UI, CLI, scripts).
      • Controller Manager: Monitors state, repairs issues, restarts failed containers.
      • Scheduler: Allocates containers to worker nodes based on resources.
      • etcd (Key-Value Store): Maintains cluster state and configuration (used for recovery).
    • Worker Nodes: Run the actual workloads (apps in containers). Each has:
      • Kubelet: Ensures containers are running and communicates with master.
      • Deployed containers (often via Docker).
  • Networking: A virtual network spans all nodes, making the cluster act as one powerful machine.
  • Resilience: Production setups typically use multiple master nodes for fault tolerance.

4. Core Concepts

  • Pod: Smallest deployable unit in Kubernetes; a wrapper for one or more containers.
    • Typically one pod per application (DB, server, message broker, etc.).
    • Each pod has its own IP address within the cluster.
    • Pods are ephemeral (can die and be recreated).
  • Service:
    • Provides a stable IP address to pods (since pods get new IPs if restarted).
    • Acts as a load balancer between pods.
    • Decouples app-to-app communication from pod lifecycle.

5. Configuration

  • All configurations go through the API Server using YAML or JSON.
  • Declarative model: Define the desired state → Kubernetes ensures reality matches.
  • Example: A Deployment request may specify:
    • my-app with 2 replicas.
    • Each replica runs a container from a specified image.
    • Environment variables and ports defined.
  • If a pod fails, the Controller Manager automatically recreates it to match the declared state.

6. Key Takeaways

  • Kubernetes = automation for container management at scale.
  • Ensures apps are always up, scalable, and recoverable.
  • Abstracts complexity: users define what they want, Kubernetes handles how it happens.

Leave a Reply

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