Chapter 14. Working with Persistent Storage
When an application is run inside a container, it has access to its own filesystem. This contains a copy of the operating system files from the image, any application server or language runtime files, as well as the source code or compiled binary for the application being run.
When the application is running, it can write files to any part of the filesystem it has permission to write to, but when the container is stopped, any changes made will be lost. This is because the local container filesystem is ephemeral.
In order to preserve data created by an application across restarts of the application, or share dynamic data between instances of an application, persistent storage is required. This may be persistent storage that is attached directly to a container the application is running in, or persistent storage attached to a separate database running in OpenShift that the application is using.
In this chapter, you will learn about persistent storage provided by OpenShift, how to make a persistent volume claim, and how to mount the persistent volume into the container for an application.
Types of Persistent Storage
When an OpenShift cluster is set up, it will be configured for persistent storage by the cluster admin. The persistent volumes available may be pre-allocated from fixed storage, or a dynamic storage provisioner can be set up with persistent volumes being allocated on demand from a persistent storage provider.
OpenShift supports ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access