Volumes

The earliest support in Kubernetes was for volumes, which can be defined by the cluster administrator, and we've already seen some variations of this construct with the configuration being exposed into a container using the Downward API back in Chapter 4, Declarative Infrastructure.

Another kind of volume that can be easily used is emptyDir, which you can use in a pod specification to create an empty directory, and mount it to one or more of the containers in your pod. This is typically created on whatever storage the local node has available, but includes an option to specify a medium of memory, which you can use to make a temporary memory-backed filesystem. This takes up more memory on the node, but creates a very fast, ephemeral ...

Get Kubernetes for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.