liveBook · Manning

Tmpfs

As explained in Kubernetes in Action, Second Edition

tmpfs is a memory-backed filesystem whose stored contents reside in volatile memory.

tmpfs is a virtual filesystem that keeps files in volatile memory instead of on a hard disk. In Kubernetes, an emptyDir volume uses tmpfs when its medium is set to Memory. This can provide faster I/O and avoid writing sensitive data to disk, but the contents disappear when the pod is deleted. section 9.2.1

Configure an in-memory emptyDir volume

Set the volume medium to Memory: volumes: - name: content emptyDir: medium: Memory Mount this volume into a container as usual. Set sizeLimit as well, especially when the pod has memory resource limits, because the volume consumes memory. section 9.2.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines tmpfs and demonstrates its emptyDir configuration, while stopping short of filesystem implementation internals.
Examples
Uses an emptyDir manifest with medium set to Memory and a sizeLimit configuration table.
What it assumes
Assumes basic Kubernetes pods and volumes while explaining the storage-medium choice and volatile lifecycle.
What you can do after
Configure an in-memory emptyDir volume and limit its storage when pod memory usage requires control.
How it connects
Connects tmpfs with emptyDir, pod lifecycle, persistent volumes, Secret data, and memory resource limits.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes in Action, Second Edition. The section links point to the parts of the book it draws on.