Kubernetes Pods

What is a Pod?

A Pod is the smallest deployable unit in Kubernetes. It represents a single instance of a running process in your cluster. A Pod encapsulates one or more containers (such as Docker containers), storage resources, a unique network IP, and options that govern how the containers should run.

Think of a Pod as a "logical host" for your application container. While most Pods contain a single container, some designs use multiple containers that need to share resources tightly — for example, a web server container paired with a sidecar that collects logs.

Container Specification

Each container in a Pod is defined with a specification that includes:

Pod Manifest Example

Here is a basic Pod manifest in YAML:

apiVersion: v1
kind: Pod
metadata:
  name: my-first-pod
  labels:
    app: my-app
spec:
  containers:
    - name: web
      image: nginx:1.25
      ports:
        - containerPort: 80

Key fields to understand:

Exercise: Complete the Pod Manifest

The following Pod manifest is missing the image field for the container. Fill in the correct field name and value to run an nginx:1.25 container.