A Pod is the atomic unit of Kubernetes. It represents a single instance of a running process in your cluster. You never deploy containers directly; you always deploy them inside Pods.
1. Creating a Basic Pod
Pods are usually defined in YAML files.
pod.yaml:
apiVersion: v1
kind: Pod
metadata:
name: nginx-pod
labels:
app: web
spec:
containers:
- name: nginx-container
image: nginx:1.14.2
ports:
- containerPort: 80Apply the Manifest
Action:
kubectl apply -f pod.yamlResult:
pod/nginx-pod created2. Inspecting Pods
Once a Pod is created, you need to verify it's running correctly.
List Pods
Action:
kubectl get podsResult:
NAME READY STATUS RESTARTS AGE
nginx-pod 1/1 Running 0 30sDescribe Pod Details
Use this when a Pod is stuck in Pending or Error state.
Action:
kubectl describe pod nginx-podResult:
Name: nginx-pod
Namespace: default
Node: minikube/192.168.49.2
Start Time: Fri, 10 Apr 2026 12:00:00 +0000
Labels: app=web
Status: Running
IP: 172.17.0.3
Containers:
nginx-container:
Image: nginx:1.14.2
...
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 45s default-scheduler Successfully assigned default/nginx-pod to minikube
Normal Pulling 44s kubelet Pulling image "nginx:1.14.2"
Normal Pulled 40s kubelet Successfully pulled image "nginx:1.14.2"
Normal Created 40s kubelet Created container nginx-container
Normal Started 39s kubelet Started container nginx-container3. Interacting with Pods
View Logs
Action:
kubectl logs nginx-podResult:
127.0.0.1 - - [10/Apr/2026:12:01:00 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.81.0" "-"Execute Commands (Shell Access)
Action:
kubectl exec -it nginx-pod -- /bin/bashResult:
root@nginx-pod:/# ls /usr/share/nginx/html
index.html
root@nginx-pod:/# exit4. Resource Requests and Limits
Every production Pod should define its resource needs to ensure stability.
Action (Manifest snippet):
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"Summary
- Pod: The smallest unit of deployment.
kubectl get pods: List your pods.kubectl describe: Debugging (Events are key!).kubectl logs: Application-level debugging.kubectl exec: Direct interaction.- Always set resource limits for production.