A Kubernetes Pod is the smallest deployable unit in Kubernetes. It groups one or more tightly coupled containers that share networking, storage, and lifecycle.
Prerequisites
- A Kubernetes cluster or local learning cluster
- The kubectl client configured for the target cluster
Create a single-container Pod
Use a declarative manifest so the desired state can be reviewed before it is applied.
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80- Save the manifest as pod-nginx.yaml.
- Review it before applying it to a non-production namespace.
- Apply it with kubectl apply -f pod-nginx.yaml.
kubectl apply -f pod-nginx.yaml
kubectl get pod nginx-pod
kubectl describe pod nginx-podVerify lifecycle and logs
Check the Pod phase, events, and container logs. A Pod is replaceable, so important state should live in an appropriate persistent service.
| State | What to check |
|---|---|
| Pending | Scheduling, resources, and image pull events |
| Running | Readiness, logs, and application health |
| Failed | Exit status, events, and previous logs |
When the experiment is complete, remove the learning resource and confirm that no important data was stored only inside the Pod.
Troubleshooting
For ImagePullBackOff, inspect the image name and pull events. For CrashLoopBackOff, inspect current and previous logs and verify the container command.
Frequently asked questions
Is a Pod the same as a container?
No. A Pod is the scheduling unit that contains one or more containers. Containers in the same Pod share networking and may mount the same volumes.
Why should I use a Deployment rather than a standalone Pod?
A Deployment manages ReplicaSets and recreates Pods when required, supports rollouts and scaling, and is usually the right starting point for a stateless application.
How do I investigate a Pod that will not start?
Run kubectl describe pod NAME to inspect events, kubectl logs NAME to inspect current logs, and kubectl logs NAME --previous when the previous container instance has crashed.
Official reference: https://kubernetes.io/docs/concepts/workloads/pods/. Check the current upstream documentation when implementing these examples.
Conclusion
Pods provide a shared execution boundary for tightly coupled containers. Use labels, explicit resources, health checks, and higher-level controllers as the workload grows.
Continue the sequence with Kubernetes Architecture Explained, then return to this Pod model before practicing kubectl Commands Explained.
Join the discussion
1 CommentsAsk questions, add context, or share what worked.
More from Melochip Editorial
Learn what Playwright testing is, why modern QA teams use it, how testers can get started, and the major types...
8 min read · Updated Nov 16, 2026
Learn how Kubernetes Deployments and ReplicaSets work with practical YAML, scaling, self-healing, rolling upda...
7 min read · Updated Nov 16, 2026
Learn Kubernetes security best practices with RBAC, Secrets, ServiceAccounts, Pod securityContext, NetworkPoli...
6 min read · Updated Nov 16, 2026Related articles
Learn how Kubernetes Deployments and ReplicaSets work with practical YAML, scaling, self-healing, rolling upda...
7 min read · Updated Nov 16, 2026
Learn Kubernetes monitoring and logs with kubectl logs, events, metrics-server, top commands, Prometheus, Graf...
6 min read · Updated Nov 16, 2026
Learn Kubernetes Ingress with controllers, IngressClass, host and path routing, TLS, DNS, annotations, redirec...
8 min read · Updated Nov 16, 2026
Learn Kubernetes ConfigMaps and Secrets with YAML, environment variables, file mounts, update behavior, immuta...
8 min read · Updated Nov 16, 2026Stay in the loop. Get new Melochip articles
Receive Melochip article updates when new articles are available. Explicit opt-in only.
nice info