Introduction to Kubernetes

Jul 11, 2024

Introduction to Kubernetes

What is Kubernetes?

  • Open-source container orchestration platform.
  • Automates deployment, scaling, and management of containerized applications.
  • Originated from Google's internal system, Borg.
  • Open-sourced by Google in 2014.

Why is it called k8s?

  • Abbreviation method: 'k' + 8 letters + 's' (Kubernetes).
  • Similar abbreviations: i18n (internationalization), l10n (localization).

Kubernetes Cluster Components

Core Pieces

  1. Control Plane: Manages the state of the cluster.
    • Runs on multiple nodes across data center zones in production.
  2. Worker Nodes: Run containerized application workloads.

Control Plane Components

  • API Server: Primary interface, exposes a RESTful API.
  • etcd: Distributed key-value store for cluster's persistent state.
  • Scheduler: Schedules pods on worker nodes based on resource needs.
  • Controller Manager: Runs controllers to manage state, e.g., replication controller and deployment controller.

Worker Node Components

  • Kubelet: Communicates with the control plane, maintains pod states.
  • Container Runtime: Manages containers (pulling images, starting/stopping containers).
  • Kube-Proxy: Network proxy, routes traffic, provides load balancing across pods.

When to Use Kubernetes?

Advantages

  • Scalability & Availability: Self-healing, auto rollbacks, horizontal scaling.
  • Portability: Consistent deployment regardless of infrastructure. Runs on-premise, public/hybrid cloud.

Disadvantages

  • Complexity: High setup and operational complexity, requires expertise.
  • Cost: Resource-intensive; may be overkill for smaller organizations.

Managed Kubernetes Services

  • Examples: Amazon EKS, GKE on Google Cloud, AKS on Azure.
  • Benefits: Offloads control plane management & maintenance, suitable for mid-sized organizations.
  • Smaller Organizations: Often do not need Kubernetes (YAGNI - You ain’t gonna need it).

Conclusion

  • Kubernetes is powerful but complex.
  • Consider managed services for easier adoption.
  • Suitable for scalable, portable containerized applications.

For further learning:

  • Check out system design books and weekly newsletters.