How Pod's get IP address in Kubernetes - What is pod sandbox in Kubernetes

networknutsdotnet Video 6 months ago

Description

In this video you will learn how Pod's are getting IP address.

So, what's inside pod?
Container running application

NO, more than that.

A Pod container a pause container/sandbox + application container

kubernetes does'nt start business application first. It must create a PAUSE / PODSANDBOX first. All containers inside pod must share the same IP address

HOW?

kubernetes create a empty network space (sandbox) first assign one IP to it keep it running and then put application containers inside that space. SANDBOX must exist before business container starts.

Its the Pause / Sandbox which own the network.

Pod Sandbox contain:
-IP address
-network namespace
-ports
-localhost

That's why the POD IP remain the same even if you restart your business application container.

A Pod sandbox is the isolated environment that provides the shared context (networking, storage, and isolation boundaries) for all containers within a Kubernetes Pod. This concept is a key part of the Kubernetes Container Runtime Interface (CRI).

In Kubernetes, the pause container serves as the “parent container” for all of the containers in your pod. The pause container has two core responsibilities. First, it serves as the basis of Linux namespace sharing in the pod. And second, with PID (process ID) namespace sharing enabled, it serves as PID 1 for each pod and reaps zombie processes.


Video Timeline:

00:00 - 03:55 - Understanding pod sandbox or pause container
03:56 - 07:55 - Checking pod sandbox with one container in a pod
07:56 - 13:10 - Checking pod sandbox with two containers in a pod