๐งฑ 1. Pods (Smallest unit in Kubernetes)
๐ฆ What is a Pod?
A Pod is the smallest deployable unit in Kubernetes.
It contains one or more containers that always run together.
๐ง Think of a Pod like:
A wrapper around your container(s).
Each Pod gets:
- Its own IP address
- Shared network namespace
- Shared storage volumes
Example:
A Pod might contain:
- 1 container โ nginx or
- 2 containers โ app + sidecar (logging agent)
Why Pods exist:
Containers need a Kubernetes-native โpackageโ to run inside the cluster.
That package is a Pod.
๐ฆ 2. Deployments (Controllers that manage Pods)
๐ฆ What is a Deployment?
A Deployment is a Kubernetes object that tells the cluster:
โRun this many Pods, keep them healthy, and update them safely.โ
A Deployment manages:
- Creating Pods
- Maintaining replica count
- Rolling updates
- Rollbacks
- Self-healing
Example:
replicas: 5
Deployment ensures 5 pods always exist.
โ Why Deployments exist:
Pods are not self-healing and not scalable.
Deployments add automation around Pods.
๐ 3. Services (Stable access to Pods)
๐ฆ What is a Service?
A Service provides a stable IP and DNS name to access Pods.
Pods come and go โ their IPs change
Service โ always stays the same
What Services do:
- Load-balance traffic to Pods
- Provide stable access even if Pods restart
- Allow communication between microservices
Types of Services:
- ClusterIP (default, internal)
- NodePort (expose app on nodeโs port)
- LoadBalancer (cloud load balancer)
- Headless Service (no load balancing, direct DNS)
โ Why Services exist:
Without Services, apps inside Kubernetes would not know how to talk to Pods.
๐๏ธ 4. Configurations (ConfigMaps & Secrets)
๐ฆ What are Configurations?
They are Kubernetes objects used to store settings for applications.
Two types:
ConfigMap
Stores non-sensitive data:
- App settings
- File contents
- Environment variables
Secret
Stores sensitive data:
- Passwords
- API keys
- Certificates
โ Why Configurations exist:
You should never hard-code sensitive or dynamic values inside the container image.
Kubernetes stores them separately and injects them at runtime.
๐ง 5. State of Every Component (What Kubernetes stores in etcd)
๐ฆ What is the โStateโ of a Component?
State means the actual condition of something right now.
Kubernetes stores the state of everything in etcd, such as:
Podsโ state:
- Running
- Pending
- Failed
- Restarts
- Conditions
- Node assigned
Deployment state:
- How many replicas are running
- How many updated replicas
- Rollout status
Node state:
- Healthy or NotReady
- Resource usage
- Labels and taints
Service state:
- ClusterIP
- Endpoints (which Pods it is routing to)
ConfigMap/Secret state:
- Key-value pairs
- Version
Container state:
- Ready
- Started
- Exit codes
- Crash loops
๐ฉ Why Kubernetes stores state:
- To know desired state (what you want)
- To know actual state (what is happening)
- To let controllers fix mismatches
Example:
Desired: 5 Pods
Actual: 3 Pods running
โ Controller creates 2 new Pods automatically
๐ฏ Final Summary
| Concept | Simple Meaning | Purpose |
|---|---|---|
| Pods | Smallest unit; wrapper for containers | Runs containers |
| Deployments | Manage Pods at scale | Scaling, rollouts, self-healing |
| Services | Stable access to Pods | Networking + load balancing |
| Configurations | Store settings & secrets | Decouple config from code |
| State of Components | Clusterโs memory in etcd | Enables automation & self-healing |
Top comments (0)