Kubernetes resources (objects) are represented by YAML manifests. Each object serves a specific purpose and contains a set of core configuration fields. Understanding these objects is essential because almost every Kubernetes deployment is built using combinations of these resources.
| Kubernetes Object (kind) | What it Does (Description) | Core Elements in YAML File |
|---|---|---|
| Pod | The smallest deployable unit in Kubernetes. It represents a single running process and contains one or more tightly coupled containers. |
|
| Deployment | Manages a replicated pool of stateless Pods. Handles rolling updates, rollbacks, and ensures a desired number of Pods remain available. |
|
| StatefulSet | Similar to a Deployment, but designed for applications requiring stable identities, ordered deployment, and persistent storage such as databases. |
|
| DaemonSet | Ensures all (or selected) Nodes run exactly one copy of a Pod. Commonly used for monitoring agents, logging agents, and networking components. |
|
| Job | Creates one or more Pods and ensures that a specified number of them successfully complete before terminating. |
|
| CronJob | Creates Jobs on a recurring schedule using Linux cron syntax. |
|
| Service | Exposes Pods through a stable network endpoint and provides load balancing across multiple Pod replicas. |
|
| Ingress | Manages external HTTP/HTTPS access to Services, typically providing URL routing and SSL/TLS termination. |
|
| ConfigMap | Stores non-sensitive configuration data as key-value pairs that applications can consume as environment variables or mounted files. |
|
| Secret | Stores sensitive information such as passwords, API keys, certificates, and authentication tokens. |
|
| PersistentVolumeClaim (PVC) | A request for storage by a user. It abstracts the underlying storage infrastructure and allows Pods to consume persistent storage easily. |
|
Common Structure Shared by Most Kubernetes Objects
Although Kubernetes objects serve different purposes, most YAML manifests share a common top-level structure.
✓ Key Observation
Most Kubernetes resources contain the following mandatory sections:
Most Kubernetes resources contain the following mandatory sections:
apiVersion— Defines the API group and version.kind— Defines the Kubernetes object type.metadata— Stores names, labels, annotations, and identifiers.
⚠ Important Note
The object-specific behavior is usually defined inside the
The object-specific behavior is usually defined inside the
spec section, while Kubernetes automatically maintains runtime
information inside the status section.
Tip
If you understand the structure of a Pod, Deployment, Service, ConfigMap, Secret, and PVC, you can understand approximately 80% of the Kubernetes YAML files encountered in real-world projects.
If you understand the structure of a Pod, Deployment, Service, ConfigMap, Secret, and PVC, you can understand approximately 80% of the Kubernetes YAML files encountered in real-world projects.
No comments:
Post a Comment