Blog

Understanding Kubernetes Persistent Volume Provisioning

Storage is required by containers and pods for a variety of purposes, from caching data to building stateful applications, such as database services. Kubernetes uses persistent volumes to create a separation between the application developers that simply require storage for their pods and the lower level details of how that storage is provisioned.

This layer of abstraction allows the storage implementation to be controlled independently of requesting applications. That means that, for example, storage can be provisioned using local storage in a development cluster and with a more robust solution in production.

In this article, we will take a look at Kubernetes persistent volume provisioning in detail and show how dynamic provisioning with NetApp Trident and Cloud Volumes ONTAP creates a compelling solution for deploying and managing storage in a Kubernetes cluster.

Provisioning Persistent Volumes


What are persistent volumes? Persistent volumes provide storage resources to pods in the same way that nodes provide compute. Each persistent volume is created by a provisioner that uses a plugin to interface with different types of backend storage, with support for Amazon EBS, Google Persistent Disk, and Azure Disk Storage among many others. The lifetime of a persistent volume is determined by its reclaim policy, which controls the action the cluster will take when a pod releases its ownership of the storage.

This is how it works: Each pod uses a persistent volume claim to bind to storage from the cluster of a particular size, access mode, and volume mode. The claim can also use a selector to only match volumes with a specific set of labels. On receiving a claim, the cluster will search for an existing persistent volume with which to fulfil the request. Cluster administrators can pre-allocate persistent volumes for the cluster, known as static provisioning, however, this requires prior knowledge of storage requirements as a whole.

Cloud Volumes ONTAP brings NetApp power to AWS and AzureThere’s another way to do this too. Dynamic volume provisioning is an alternative model for managing storage provisioning in Kubernetes, and is used to automatically deploy persistent volumes based on the claims received by the cluster. The Kubernetes storage class specified by a persistent volume claim defines the provisioner to be used to create the new persistent volume. Kubernetes provides a number of its own internal Kubernetes provisioners that make use of the plugins mentioned above, however, external provisioners are also supported.

Cloud Volumes ONTAP and NetApp Trident


Cloud Volumes ONTAP brings the power of NetApp appliances to AWS storage and Azure storage through the use of the native compute and storage resources available in each cloud environment. Cloud Volumes ONTAP provides major advantages for storage management in the cloud, including:

  • Storage Efficiencies: Cloud Volumes ONTAP reduces cloud storage footprint and costs through several built-in technologies, such as data deduplication and data compression. Thin provisioning removes the need to pre-allocate large volumes of storage that may not end up being used, and instead lets you grow as you go.

  • Data Tiering: In order to further improve cost effectiveness for infrequently-used data, Cloud Volumes ONTAP offers data tiering: the ability to transparently move cold data to Amazon S3 or Azure Blob and move it back into the performance tier on client access.

  • High Availability: To ensure that data is always accessible and resilient against data loss, Cloud Volumes ONTAP HA deploys a failover pair of nodes that can be placed across Availability Zones.

  • Data Protection: Snapshots provide an instant and space efficient backup solution for the data stored in Cloud Volumes ONTAP, which can be instantly restored back to the source volume at any time. Using SnapMirror® for data replication, storage volumes can be replicated to other Cloud Volumes ONTAP deployments, or integrated with on-premises systems in a hybrid cloud environment.

  • Storage Cloning: Cloud Volumes ONTAP uses NetApp FlexClone® to instantly clone an existing storage volume and make it available for read/write access. This process does not involve any data copying and only requires storage space for the changes made to the clone.

NetApp Trident is a fully-supported, open-source storage provisioner for Kubernetes that uses Cloud Volumes ONTAP or on-premises NetApp ONTAP systems for its backend storage. This allows pods to automatically access the storage they require, while at the same time benefiting from the data management capabilities of Cloud Volumes ONTAP. For example, as well as provisioning new storage volumes, Trident can also integrate with storage cloning to create a clone of an existing volume in response to a persistent volume claim. This is ideal for supporting DevOps pipelines and building test clusters.

Conclusion


Kubernetes persistent volumes create a separation between containerized applications and the storage they use, which enables much greater flexibility when it comes to how that storage is provisioned. The Trident provisioner from NetApp leverages the effectiveness of the Cloud Volumes ONTAP data management platform from within Kubernetes, adding great value to your use of cloud storage.

Visit us online to find out more about Cloud Volumes ONTAP, or start a free 30-day trial on AWS or Azure.
-