Get startedGet started for free

Volumes

1. Volumes

In GKE, a storage abstraction is a layer of software that allows you to interact with storage in a consistent way, regardless of who the underlying storage provider is. This abstraction layer is important because it helps simplify the process of provisioning and managing storage, it provides a consistent interface for accessing storage, and it lets you use different storage providers so you have more flexibility in choosing the right storage for your needs. The standard storage abstractions that Kubernetes provides are Volumes and PersistentVolumes. Let’s examine the difference between the two and how they can be used to store and share information between Pods. We’ll begin with Volumes. Kubernetes uses objects to represent the resources it manages, and this applies to both storage and Pods. A Volume is a directory accessible to all containers in a Pod. Some Volumes are ephemeral, which means they last only as long as the Pod to which they are attached. However, some Volumes are persistent, which means that they can outlive a Pod. Volumes are attached to Pods, not containers. This is important to understand because if a Pod isn't mapped to a node, then the Volume won’t be either. And then there are PersistentVolumes, or PVs, which are cluster resources that exist independently of Pods, and are used to manage durable storage in a cluster. In GKE, a PersistentVolume is typically–as the name states–backed by a persistent disk. This means that any disk or data represented by a PersistentVolume will continue to exist even as a cluster changes or if Pods are deleted and recreated. PersistentVolume resources can be provisioned dynamically through PersistentVolumeClaims, or they can be explicitly created by a cluster administrator.

2. Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.