7 Mounting storage volumes into the Pod’s containers

 

This chapter covers

  • Persisting files across container restarts
  • Sharing files between containers of the same pod
  • Sharing files between pods
  • Attaching network storage to pods
  • Accessing the host node filesystem from within a pod

The previous two chapters focused on the pod’s containers, but they are only half of what a pod typically contains. They are typically accompanied by storage volumes that allow a pod’s containers to store data for the lifetime of the pod or beyond, or to share files with the other containers of the pod. This is the focus of this chapter.

Note

7.1 Introducing volumes

A pod is like a small logical computer that runs a single application. This application can consist of one or more containers that run the application processes. These processes share computing resources such as CPU, RAM, network interfaces, and others. In a typical computer, the processes use the same filesystem, but this isn’t the case with containers. Instead, each container has its own isolated filesystem provided by the container image.

7.1.1 Demonstrating the need for volumes

 

7.1.2 Understanding how volumes fit into pods

 
 
 
 

7.2 Using an emptyDir volume

 
 
 

7.2.1 Persisting files across container restarts

 
 

7.2.2 Populating an emptyDir volume with data using an init container

 
 
 
 

7.2.3 Sharing files between containers

 

7.3 Using external storage in pods

 
 
 

7.3.1 Using a Google Compute Engine Persistent Disk as a volume

 
 

7.3.2 Using other persistent volume types

 
 
 
 

7.3.3 Understanding how external volumes are mounted

 

7.4 Accessing files on the worker node’s filesystem

 
 
 

7.4.1 Introducing the hostPath volume

 
 
 

7.4.2 Using a hostPath volume

 
 
 

7.5 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest