What Is Dynamic Volume Provisioning?

There might be a case when the PersistentVolumeClaims (request for storage) does not match with the Persistent Volume created by the administrator. In this case, the cluster dynamically provisions the volume for the PVC. This is implemented using the concept of StorageClass.

First, the administrator defines the StorageClass that contains the fields provisioner, parameters, and reclaimPolicy. Then, the PVC requests the StorageClass to dynamically provision the storage volumes to the pod. You can understand the entire workflow through the below points.

  • The pods create a PVC object specifying its storage requirements, such as storage class, access mode, and storage size. Then, they submit it to the Kubernetes API server.
  • Kubernetes evaluates the PVC and selects an appropriate StorageClass based on the requested parameters. The selected StorageClass determines the type of storage to be provisioned and the backend storage provider to use.
  • After determining the Storage Class, Kubernetes requests the corresponding provisioner to dynamically provision a PersistentVolume (PV) as per the PVC’s requirements.
  • After the PV is provisioned, Kubernetes automatically binds it to the requesting PVC so that the pod can access the storage volumes. Hence, the pod can read from and write to the volume as needed, ensuring data persistence across pod restarts and rescheduling events.

Kubernetes Volume Provisioning: Dynamic VS Static

Are you facing issues in allocating resources in the Kubernetes Environment? If yes, look no further guides. We are here to help you with this insightful article which covers a detailed explanation of the Kubernetes Volume Provisioning. If you reach to end of this guide, all your doubts about the Kubernetes Volume Provisioning will be resolved.

Deploying applications in the form of containers is one of the most widely acceptable approaches in today’s world. But, allocating storage to those containers is equally important. This helps us to ensure the durability and high availability of the containerized workloads. Hence, it becomes important to learn various Volume Provisioning Strategies to make our Kubernetes Environment scalable.

In this article, we will learn about Volume Provisioning and its types namely, static and dynamic. So, let us start without any delay.

Table of Content

  • Overview Of Kubernetes
  • What Is Volume Provisioning?
  • What Is Static Volume Provisioning?
  • Implementation of Static Volume Provisioning
  • What Is Dynamic Volume Provisioning?
  • Implementation Of Dynamic Volume Provisioning
  • Static Vs Dynamic Volume Provisioning: Key Differences
  • Conclusion
  • Kubernetes Volume Provisioning – FAQ’s

Similar Reads

Overview Of Kubernetes

Kubernetes, also known as K8 is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. In the Kubernetes, the containers are the entities that store the applications along with their dependencies. These containers are grouped into logical units called pods. These pods are present inside the Node, which may be physical or virtual machines. Each Node runs a Kubernetes agent called Kubelet that manages the containers and communicates with the Kubernetes control plane. However, when it comes to storing the data, the pods require some storage volumes in which the data persist even after the lifecycle of the container....

What Is Volume Provisioning?

Whenever we create the files or store the data in Kubernetes, all the data storage goes away once the Container Stops running. To prevent this, we have to allocate some volumes to the Kubernetes Containers so that the data remains persistent even if the container stops. This technique is known as Volume Provisioning in the Kubernetes....

What Is Static Volume Provisioning?

Static volume provisioning in Kubernetes refers to the manual allocation and configuration of storage volumes before they are needed by pods. Static provisioning requires administrators to pre-allocate and manage storage resources in advance so that the data remains persistent after the containers stop running. This is implemented using the Persistent Volumes (storage resources in Kubernetes) and PersistentVolumes Claims (PVC), which are the requests made by pods for storage. This process is illustrated as shown below....

Implementation Of Static Volume Provisioning

Navigate To your Kubernetes Cluster. Create a kubernetes Persistent Volume yaml file as provided in below and save it with a name such as a sample.yaml The implementation of Static Volume Provisioning is shown below in the below YAML code....

What Is Dynamic Volume Provisioning?

There might be a case when the PersistentVolumeClaims (request for storage) does not match with the Persistent Volume created by the administrator. In this case, the cluster dynamically provisions the volume for the PVC. This is implemented using the concept of StorageClass....

Implementation Of Dynamic Volume Provisioning

If you implement this kind of Volume Provisioning, the YAML file should look as shown below....

Static Vs Dynamic Volume Provisioning: Key Differences

The following are the key differences between static and dynamic volume provisioning:...

Conclusion

To conclude, Kubernetes is popular and efficient for containerization of the applications. However, we may face challenges when the container stops running as the data storage goes away. Kubernetes provides Storage Provisioning to overcome this challenge. It involves the allocation of the storage volumes to the pods....

Kubernetes Volume Provisioning – FAQ’s

Which Storage Providers Are Supported For Dynamic Volume Provisioning In Kubernetes?...