Kubernetes Basics
Kubernetes is an
open-source platform designed to automate the deployment, scaling, and
management of containerized applications. In 2026, it remains the global
standard for container orchestration, increasingly used for complex workloads
like AI/ML pipelines, edge computing, and multi-cloud environments.
1. Core
Architecture (The Cluster)
A Kubernetes
environment is called a Cluster, which consists of two primary
parts:
- Control Plane (The Brain): The central management
layer that makes global decisions about the cluster (e.g., scheduling) and
detects/responds to cluster events.
- API Server: The entry point for all
commands (via kubectl or code).
- etcd: A highly available
key-value store that holds the entire cluster state and configuration.
- Scheduler: Matches new pods to
healthy nodes based on resource needs.
- Controller Manager: Continuously monitors the
cluster to ensure the "actual state" matches your "desired
state".
- Worker Nodes (The Muscle): Machines (physical or
virtual) where application containers actually run.
- Kubelet: An agent on each node
that ensures containers are running in their pods.
- Kube-Proxy: Handles networking and
traffic routing between pods.
- Container Runtime: The engine (like containerd or CRI-O)
that runs the containers.
2. Key
Objects & Resources
Kubernetes
manages workloads through declarative objects, typically defined in YAML files.
- Pod: The smallest deployable
unit; it encapsulates one or more tightly coupled containers that share
storage and network resources.
- Deployment: Describes the desired
state for your application (e.g., "run 3 copies of this app").
It manages updates and rollbacks automatically.
- Service: Provides a stable,
permanent IP address or DNS name for a set of pods, enabling reliable
communication even as pods are created or destroyed.
- Namespace: A virtual cluster within a
physical cluster, used to isolate resources between different teams or
projects.
- ConfigMaps & Secrets: Store non-confidential
configuration and sensitive data (like passwords) separately from the
application code.
3.
Essential Features
- Self-Healing: If a container crashes,
K8s automatically restarts or replaces it.
- Horizontal Scaling: Automatically adds or
removes pods based on CPU/memory usage or custom metrics.
- Automated Rollouts/Rollbacks: Gradually updates
application versions without downtime; if an update fails, it can
automatically revert to the previous stable version.
- Storage Orchestration: Automatically mounts local
or cloud-based storage to your applications.