What is Kubernetes (K8s)?
Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications. It maintains a declared desired state, continuously reconciling actual infrastructure toward what was specified.
How Kubernetes works
The model is declarative. You describe the desired state, such as five replicas of this container with these resource limits, and controllers continuously compare actual state against it and act to close the gap. A crashed pod is replaced because actual replica count fell below desired.
The core objects are pods, which group one or more containers as the unit of scheduling; deployments, which manage replica sets and rolling updates; services, which provide stable network endpoints across changing pod IPs; and the scheduler, which places pods on nodes based on resource requests and constraints.
Why Kubernetes is used
It provides a common substrate for running services with consistent operational primitives.
- Self healing: failed pods and unhealthy nodes are replaced without intervention.
- Declarative rollouts: rolling updates and rollbacks are built in.
- Resource efficiency: bin packing across nodes improves utilization.
- Portability: the same manifests run across clouds and on premises.
Limits and operational cost
Kubernetes is complex, and the complexity is not optional. Networking, storage, ingress, RBAC, and resource management each have significant depth, and a team adopting it takes on a substantial operational surface that has to be learned and maintained.
It also relocates problems rather than eliminating them. Resource limits set incorrectly produce OOMKilled containers, requests set too high produce unschedulable pods, and the failure modes are Kubernetes specific rather than application specific. For small deployments, the operational cost frequently exceeds the benefit.
Kubernetes vs serverless
Serverless platforms abstract infrastructure entirely: you deploy a function or container and the platform handles scaling, placement, and capacity. Operational burden is minimal and control is minimal.
Kubernetes gives full control over scheduling, networking, and resource allocation, at the cost of operating the cluster. The choice usually comes down to whether you need that control. Teams running many services with varied requirements, specific networking needs, or workloads that do not fit serverless constraints choose Kubernetes. Teams running a handful of stateless services often find serverless cheaper in both money and attention.
Key takeaways
- Kubernetes reconciles actual state toward a declared desired state through controllers.
- Core objects are pods, deployments, services, and the scheduler that places workloads on nodes.
- The operational complexity is substantial and unavoidable, spanning networking, storage, and RBAC.
- It relocates failure modes into Kubernetes specific ones such as OOMKilled and unschedulable pods.
Frequently asked
Sources
- Kubernetes: concepts overviewkubernetes.io