Kubernetes Basics: Running Pods – Complete Tutorial
This tutorial will guide you from the very basics to running, viewing, and managing Pods — the smallest and most fundamental building block in Kubernetes. By the end, you’ll understand what Pods are, how to create them, and how to work with them in a real cluster.
📋 Prerequisites
Before starting, make sure you have:
- A running Kubernetes cluster (can be local: Minikube, Kind, or cloud-based: EKS, GKE, AKS)
kubectlinstalled and configured to connect to your cluster- Basic understanding of containers (e.g., Docker)
✅ Check your setup:
kubectl version --short kubectl cluster-info
1. What is a Pod?
A Pod is Kubernetes’ core execution unit. It represents:
- A single running process in your cluster (or tightly coupled group of processes)
- One or more containers that share:
- Networking (same IP address, localhost)
- Storage volumes
- Linux namespaces and cgroups
Key facts:
- Pods are ephemeral — they are created, destroyed, and replaced; never “updated” in place.
- Usually you don’t create standalone Pods directly — you use controllers like
DeploymentsorStatefulSets— but understanding Pods is essential.
2. Running a Pod: Imperative Way
The simplest way to run a Pod is with an imperative command — you tell Kubernetes what to do directly.
Example: Run an Nginx Pod
kubectl run nginx-pod --image=nginx:alpine