Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker layer across pods

Most of my images that I deploy into Kubernetes has the common base (From) image. So, I have multiple applications deployed into multiple pods. How does the Docker layer cache work across multiple pods, as the From image is same for all the pods?

like image 372
user1578872 Avatar asked Jun 27 '18 04:06

user1578872


1 Answers

See "How Pods manage multiple Containers"

Pods are designed to support multiple cooperating processes (as containers) that form a cohesive unit of service.
The containers in a Pod are automatically co-located and co-scheduled on the same physical or virtual machine in the cluster.
The containers can share resources and dependencies, communicate with one another, and coordinate when and how they are terminated.

So, within the same cluster, your pods will share the same container runtime (for instance docker, but others exist).
Which means the layers of your base image will be reused by the various containers running in those pods.
Then each container will write to its special UnionFS (which can use one of a few different storage backends, such as aufs or btrfs, there are several choices), using copy-on-write.

like image 87
VonC Avatar answered Sep 28 '22 08:09

VonC