Kubernetes (K8s)
Definition
Kubernetes (abbreviated K8s) is an open-source container orchestration platform originally developed by Google, now maintained by the CNCF. It automates the deployment, scaling, and management of containerized applications across clusters of machines.
Kubernetes groups containers into logical units (Pods) for easy management and discovery, providing declarative configuration and automation.
Key Concepts
- Pod: Smallest deployable unit; one or more containers sharing network/storage
- Service: Stable network endpoint for a set of Pods (ClusterIP, NodePort, LoadBalancer)
- Deployment: Manages ReplicaSets for declarative Pod updates
- ConfigMap/Secret: Configuration data and sensitive values injected into Pods
- Namespace: Virtual cluster within a physical cluster (logical isolation)
- Ingress: HTTP/HTTPS routing rules for external access
- PersistentVolume (PV): Storage provisioned by the cluster
- PersistentVolumeClaim (PVC): Request for storage by a Pod
- Node: A worker machine (VM or physical) in the cluster
- Control Plane: Master components (API server, scheduler, controller-manager, etcd)
Architecture
Control Plane (Master)
├── API Server (kubectl communicates here)
├── etcd (cluster state database)
├── Scheduler (assigns Pods to Nodes)
└── Controller Manager
Worker Nodes
├── kubelet (agent managing Pod lifecycle)
├── kube-proxy (network routing)
├── Container Runtime (containerd, CRI-O)
└── Pods (running containers)
Core Kubernetes Objects
| Object | Purpose |
|---|---|
| Pod | Single or co-located containers |
| Service | Network abstraction for Pods |
| Deployment | Managed ReplicaSet for stateless apps |
| StatefulSet | Managed Pods with stable identities (databases) |
| DaemonSet | One Pod per Node |
| Job/CronJob | One-time/scheduled tasks |
| Namespace | Logical resource isolation |
| ConfigMap | Non-secret configuration |
| Secret | Sensitive data (base64-encoded) |
Alternatives to Kubernetes
| Tool | Type | Notes |
|---|---|---|
| Docker Swarm | Container orchestration | Simpler, Docker-native, legacy |
| Nomad | General scheduler | HashiCorp, simpler than K8s |
| OpenShift | K8s distribution | Red Hat’s enterprise K8s |
| Rancher | K8s management | Multi-cluster K8s management |
| EKS/AKS/GKE | Managed K8s | Cloud provider managed control plane |
Related Terms
- Docker — Kubernetes package manager
- Terraform — GitOps deployment for Kubernetes
- Container Runtime — containerd, CRI-O (Kubernetes uses CRI interface)
References
- Kubernetes docs: https://kubernetes.io/docs/
- CNCF Kubernetes: https://www.cncf.io/projects/kubernetes/
- Kubernetes concepts: https://kubernetes.io/docs/concepts/