Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.karchunt.com/llms.txt

Use this file to discover all available pages before exploring further.

What is a Pod?

Pod is a single instance of an application and is the smallest unit of a Kubernetes application. It basically wraps container or provides an abstraction layer over container which isolates the application from the underlying infrastructure. Normally, pod is only run one application container inside it (one-to-one relationship). However, there are some cases where you can run multiple containers inside a pod, which is called multi-container pod. Each pod will have its own IP address and port space, which means that the containers inside the pod can communicate with each other using localhost and ports, as they’re sharing the same network space. They can also share the same storage space, which is called volume.
When a pod is recreated, it will get a new IP address. So, if you want to communicate from a pod to another pod, you should use the service name instead of its IP address.

Pod YAML File

Below is the sample pod YAML file that contains the basic fields of a pod definition.
pod.yaml
apiVersion: v1
kind: Pod
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  containers:
    - name: nginx
      image: nginx:1.29
      ports:
        - containerPort: 80
To create a pod using the above YAML file, you can use the following command:
kubectl apply -f pod.yaml
Last modified on May 9, 2026