π§± 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)