Enhancing storage management in Kubernetes with PV resources
A PV resource presents a unit of storage that can be used within Kubernetes. PVs can be created manually or dynamically by a storage provisioning backend.
While the volume definitions seen so far are declared namespace-wide, PV resources are defined cluster-wide, by Kubernetes administrators. We use them to define the storage capacity (size) using the capacity.storage
key and the mode it will be consumed using the accessMode
key. Let’s quickly review these modes, because our applications may need specific access to the data, especially when we run multiple replicas of a process:
ReadWriteOnce
: This mode presents the storage in write mode only for the first Pod that attaches it. Other Pods (replicas or even defined in other different workloads) can only have read access to the data.ReadOnlyMany
: In this mode, all the Pods will mount the volume in read-only mode.ReadWriteMany
: This is the option...