Pods: Architecture & Lifecycle
A Pod is the smallest deployable computing unit in Kubernetes. A Pod encapsulates one or more containers that share storage, network IP address, and runtime specifications.
1. Pod Lifecycle Phases
Section titled “1. Pod Lifecycle Phases” ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌───────────┐ │ Pending │ ───► │ Running │ ───► │Succeeded│ OR │ Failed │ └─────────┘ └─────────┘ └─────────┘ └───────────┘- Pending: The Pod has been accepted by the API Server, but one or more containers have not been scheduled or images are still downloading.
- Running: Bound to a node, all containers have been created, and at least one container is currently executing or restarting.
- Succeeded: All containers in the Pod terminated successfully with exit code 0.
- Failed: All containers have terminated, and at least one container exited with a non-zero exit status.
- Unknown: The state of the Pod cannot be obtained, typically due to network communication failure with the host Kubelet.
2. Pod Manifest Example
Section titled “2. Pod Manifest Example”apiVersion: v1kind: Podmetadata: name: nginx-pod labels: app: webspec: containers: - name: nginx image: nginx:1.25-alpine ports: - containerPort: 80 resources: requests: memory: "64Mi" cpu: "100m" limits: memory: "128Mi" cpu: "250m"