102 β€” Your First Pod

Beginner

Learn to create, inspect, and manage Pods - the smallest deployable units in Kubernetes. Understand the pod lifecycle and basic troubleshooting.

Learning Objectives

1
Create pods using kubectl run and YAML manifests
2
Inspect pod status and logs
3
Execute commands inside pods
4
Delete and manage pod lifecycle
Step 1

Create your first pod imperatively

Use kubectl run to quickly create a pod from the command line.

Commands to Run

kubectl run nginx-pod --image=nginx:alpine
kubectl get pods
kubectl get pods -o wide

What This Does

'kubectl run' creates a pod with the specified name and container image. Pods are the smallest deployable units in Kubernetes - typically one container, sometimes more.

Expected Outcome

You'll see the pod creation confirmation, then status showing ContainerCreating β†’ Running. The -o wide flag shows the node and IP address.

Pro Tips

  • 1
    Pods are ephemeral - they can be deleted and recreated
  • 2
    Each pod gets a unique IP address within the cluster
  • 3
    ContainerCreating status means Kubernetes is pulling the image
  • 4
    Use --image to specify any Docker image from Docker Hub or registries
  • 5
    Pod names must be unique within a namespace

Common Mistakes to Avoid

  • ⚠️Not waiting for pod to reach Running status before proceeding
  • ⚠️Using invalid pod names (must be lowercase, alphanumeric, hyphens only)
Was this step helpful?

All Steps (0 / 10 completed)