Services

Resources

Company

/

Kubernetes pod

Kubernetes pod

A pod is the smallest unit you can deploy in Kubernetes. It wraps one or more containers that always run together on the same node. The containers in a pod share one IP address and network namespace, so they reach each other on localhost, and they can mount the same volumes.

How it works

Most pods run one application container. Some add a sidecar, such as a log shipper or proxy, that needs the same network or files. You rarely create pods directly: a Deployment, StatefulSet or Job creates them from a template and replaces them when they fail.

For example, kubectl get pods might show checkout-7d9f 2/2 Running with IP 10.0.1.17: two containers, both ready. The app listens on port 8080 and the sidecar reads from it at localhost:8080.

Why it matters in production

Pods are disposable. When one is rescheduled it gets a new name and a new IP, so clients should reach pods through a Service, not by IP. Each pod also takes an IP from the cluster's pod range, so large clusters can run out of addresses before they run out of CPU.

See also

On the One2N blog

References

  1. Pods (Kubernetes documentation)

Inside a Kubernetes pod, shown by kubectl as checkout-7d9f 2/2 Running: one pod with IP 10.0.1.17 holds an app container listening on :8080 and a sidecar that reaches it at localhost:8080, and both mount the same volume. A client reaches the pod through a Service. A second client that calls the pod by IP has a red X on its path, because the IP is gone after the pod is rescheduled.

Putting this into practice?

Talk to One2N about our platform engineering services

Talk to One2N about our platform engineering services