liveBook · Manning

File system

As explained in Kubernetes in Action, Second Edition

A filesystem is a structure and set of operations for organizing, storing, and accessing files, including the isolated filesystem presented to a container.

A filesystem organizes, stores, and exposes files through operations such as reading and writing. In containers, each container starts with an isolated filesystem derived from its image. Mounting attaches another volume or storage filesystem at a location in that file tree. section 9.1 section 2.1.2

Container filesystems have several operational distinctions:

  • Image files are present when a container starts, but changes made inside the container disappear when it is replaced after termination. section 9.1
  • A volume preserves all or part of an application filesystem across container restarts when mounted into the pod and container. section 9.1
  • Containers in one pod still have separate mount namespaces; mounting the same volume into both lets them share selected files. section 5.1.1
  • A hostPath volume exposes a path from the node filesystem, such as /run/xtables.lock or /lib/modules, to a pod container. section 17.2.2

A node filesystem exposed through hostPath

A kube-proxy DaemonSet uses hostPath volumes to access the node’s /run/xtables.lock file and /lib/modules directory. This enables a per-node process to use host networking-related files and installed kernel modules. section 17.2.2

Figure 9.1 Mounting a filesystem into the file tree
figure

Use the filesystem-mounting diagram to see how a volume becomes available at a location inside a container’s file tree. section 9.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Defines isolation, mounting, persistence, and mount namespaces, then demonstrates hostPath usage without detailing filesystem implementation internals.
Examples
Uses container restarts, shared pod volumes, and kube-proxy hostPath mounts for /run/xtables.lock and /lib/modules.
What it assumes
Assumes basic containers and pods while teaching isolated filesystems, mounting, persistence, and shared volume behavior.
What you can do after
Operate/configure container storage by mounting volumes for persistence or sharing and exposing node paths through hostPath.
How it connects
Connects filesystems with container images, containers, pods, volumes, mount namespaces, DaemonSets, and hostPath volumes.

Also explained in

Compare how 4 books explain file system →

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.