Tutorials DevOps & Cloud Architect Mastery
Pods, Deployments, and Services: The core building blocks
On this page
Kubernetes Building Blocks
You never create a "Container" in K8s. You create Abstractions. These abstractions handle the life cycle and networking of your containers automatically.
1. Pods (The Atomic Unit)
A Pod is a wrapper around one or more containers. Containers in the same pod share the same IP and can talk to each other via localhost. **Architect Tip:** Never deploy a raw Pod. If it dies, it stays dead.
2. Deployments (Self-Healing)
A Deployment manages Pods. You tell K8s: "I want 3 replicas of my API." If one Pod crashes or a server dies, the Deployment controller detects the mismatch and immediately spawns a new Pod on a healthy server. This is true **Self-Healing**.
3. Services (Internal Load Balancing)
Pods are ephemeral—they get new IP addresses when they restart. A Service provides a stable IP address and DNS name (e.g., api-service) that routes traffic to all healthy Pods in a deployment. It is the internal load balancer of K8s.
4. Interview Mastery
Q: "What is the difference between a ClusterIP, NodePort, and LoadBalancer service?"
Architect Answer: "1) **ClusterIP** is the default—only accessible *inside* the cluster. 2) **NodePort** opens a specific port on every server in the cluster (e.g., 30001) to the outside world. 3) **LoadBalancer** is for cloud providers; it automatically provisions a real Cloud Load Balancer (like AWS ELB) and points it to your Service. In production, we almost always use **Ingress** instead of NodePort for public traffic."