You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
A pod is the smallest deployable unit in Kubernetes. It represents one or more containers that share the same network namespace and storage volumes. Pods are ephemeral by design — if a pod is deleted or its node fails, Kubernetes creates a replacement rather than restarting the original.
Kubernetes wraps containers in pods to allow tightly coupled processes to share resources. Two containers in the same pod share the same IP address and port space, can communicate via localhost, and can read from the same mounted volumes. A common pattern is the sidecar: a helper container (for logging, proxying, or syncing) running alongside the main application container in the same pod.
apiVersion: v1
kind: Pod
metadata:
name: my-app
labels:
app: my-app
spec:
containers:
- name: app
image: nginx:1.25
ports:
- containerPort: 80
resources:
requests:
cpu: "100m"
memory: "128Mi"
limits:
cpu: "500m"
memory: "256Mi"
Key fields:
A pod moves through several phases:
# Apply a pod manifest
kubectl apply -f pod.yaml
# List pods in the current namespace
kubectl get pods
# Show detailed information including events
kubectl describe pod my-app
# Stream logs from a running pod
kubectl logs -f my-app
# Open an interactive shell inside a pod
kubectl exec -it my-app -- /bin/sh
Kubernetes supports three types of health probes:
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.