Pod Resource Basics
Introduction: From Verification to Deployment
In the previous lesson, you verified that kubectl works and can connect to your Kubernetes cluster. You confirmed your environment is ready by checking the client version, cluster information, and available nodes. Now comes the exciting part: actually running something on Kubernetes.
The natural next question is: "How do I deploy my application to this cluster?" In this lesson, you'll learn how to create and manage your first Pod using a declarative configuration file. By the end, you'll understand what Pods are, why we use YAML files to define them, and how to create, verify, update, and delete Pods using kubectl. This is the foundation for everything else you'll do with Kubernetes.
What Is a Pod?
A Pod is the smallest deployable unit in Kubernetes. When you want to run an application in Kubernetes, you don't deploy containers directly — you deploy Pods. While a Pod can technically contain multiple containers, the most common pattern is one container per Pod. Think of a Pod as a wrapper around your container that provides additional capabilities like networking, storage, and lifecycle management.
Why does Kubernetes use this wrapper instead of just running containers directly? The Pod concept allows Kubernetes to group tightly coupled containers together so they share resources and context. Specifically, all containers within a single Pod share:
- Networking: They share the same network namespace, meaning they have the same IP address and port space. Containers inside the same
Podcan communicate with each other usinglocalhost, just as if they were processes running on the same server. - Storage: They can share storage volumes, allowing them to read and write to the same files.
In real-world terms, a Pod represents one instance of your application running in the cluster. If you're running a web server, one Pod equals one running copy of that web server. If you need to handle more traffic, you'd run multiple Pods (we'll cover that in later lessons).
It is also important to understand that Pods are ephemeral (temporary). They are designed to be disposable. If a Pod dies or the node it is running on fails, the Pod is not "healed"; instead, it is usually replaced by a brand new Pod. This is why we treat Pods as disposable resources rather than unique, permanent servers.
For this lesson, we'll create a Pod that runs nginx, a popular web server. This is a perfect first example because nginx is simple, well-known, and easy to verify — once it's running, we know we have a working web server in our cluster. The Pod will contain a single nginx container, which is the typical pattern you'll use most often.
