All Kuberneters - Components
Kubernetes Core Resources Explained
1. Pods
What It Is
A Pod is the smallest deployable unit in Kubernetes.
It contains one or more containers that share:
- Network
- Storage
- Lifecycle
Used For
- Running application containers
- Grouping tightly coupled containers together
Example
A web application container running inside a pod.
2. Deployments
What It Is
A Deployment manages Pods and ReplicaSets.
Used For
- Rolling updates
- Application version upgrades
- Scaling applications
- Self-healing applications
Example
Deploying 3 replicas of an NGINX application.
3. ReplicaSets
What It Is
A ReplicaSet ensures a specified number of pod replicas are always running.
Used For
- High availability
- Maintaining desired pod count
Example
Keeping 5 backend pods running at all times.
4. DaemonSets
What It Is
A DaemonSet ensures one pod runs on every node (or selected nodes).
Used For
- Monitoring agents
- Log collectors
- Security agents
Example
Running Fluentd or Prometheus Node Exporter on all nodes.
5. StatefulSets
What It Is
A StatefulSet manages stateful applications.
Features
- Stable pod names
- Persistent storage
- Ordered deployment/startup
Used For
- Databases
- Kafka
- Elasticsearch
Example
Running MySQL with persistent volumes.
6. Services
What It Is
A Service exposes pods internally or externally.
Types
- ClusterIP
- NodePort
- LoadBalancer
- ExternalName
Used For
- Stable networking
- Load balancing
- Service discovery
Example
Exposing frontend pods to users.
7. Ingress
What It Is
Ingress manages external HTTP/HTTPS access to services.
Used For
- URL routing
- SSL termination
- Reverse proxy
Example
Routing:
- app.example.com → frontend service
- api.example.com → backend service
8. Jobs
What It Is
A Job runs a task until completion.
Used For
- Batch processing
- One-time tasks
- Database migrations
Example
Running a backup script once.
9. CronJobs
What It Is
A CronJob schedules Jobs periodically.
Used For
- Automated backups
- Scheduled reports
- Cleanup tasks
Example
Running a backup every midnight.
10. ConfigMaps
What It Is
ConfigMaps store non-sensitive configuration data.
Used For
- Environment variables
- Application configuration files
Example
Storing application settings.
11. Secrets
What It Is
Secrets store sensitive information securely.
Used For
- Passwords
- API keys
- Tokens
- Certificates
Example
Database password storage.
12. Nodes
What It Is
A Node is a worker machine in Kubernetes.
Types
- Master/Control Plane Node
- Worker Node
Used For
- Running pods and workloads
Components
- Kubelet
- Container runtime
- Kube-proxy
13. PersistentVolumes (PV)
What It Is
A PersistentVolume is cluster storage provisioned for applications.
Used For
- Persistent data storage
Example
Disk storage for databases.
14. PersistentVolumeClaims (PVC)
What It Is
A PVC requests storage from a PersistentVolume.
Used For
- Dynamically allocating storage to pods
Example
A pod requesting 10GB storage.
15. ServiceAccounts
What It Is
A ServiceAccount provides identity for pods.
Used For
- API authentication
- Access control within cluster
Example
A pod accessing Kubernetes API securely.
16. Roles
What It Is
A Role defines permissions within a namespace.
Used For
- RBAC authorization
Example
Allowing read access to pods in a namespace.
17. RoleBindings
What It Is
A RoleBinding assigns a Role to users, groups, or ServiceAccounts.
Used For
- Granting namespace-level permissions
Example
Binding pod-reader role to a developer.
8. ClusterRoles
What It Is
A ClusterRole defines cluster-wide permissions.
Used For
- Access across namespaces
- Cluster-level resources
Example
Allowing node read access cluster-wide.
19. ClusterRoleBindings
What It Is
A ClusterRoleBinding assigns ClusterRoles to users or ServiceAccounts.
Used For
- Granting cluster-wide access
Example
Giving admin privileges to DevOps team
Quick Summary Table
| Resource | Purpose |
|---|---|
| Pods | Run containers |
| Deployments | Manage stateless applications |
| ReplicaSets | Maintain pod count |
| DaemonSets | Run pod on every node |
| StatefulSets | Manage stateful applications |
| Services | Expose applications |
| Ingress | HTTP/HTTPS routing |
| Jobs | Run one-time tasks |
| CronJobs | Schedule recurring tasks |
| ConfigMaps | Store configuration |
| Secrets | Store sensitive data |
| Nodes | Worker machines |
| PersistentVolumes | Provide storage |
| PersistentVolumeClaims | Request storage |
| ServiceAccounts | Pod identity |
| Roles | Namespace permissions |
| RoleBindings | Assign namespace permissions |
| ClusterRoles | Cluster-wide permissions |
| ClusterRoleBindings | Assign cluster-wide permissions |
Comments
Post a Comment