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.

  • Administrators manually create PV objects with the desired storage configurations using YAML or JSON.
  • When a pod requires persistent storage, it creates a PVC object specifying the storage requirements, such as storage class, access mode, and storage size.
  • Kubernetes attempts to bind the PVC to a suitable PV based on the matching criteria. If a matching PV is found and available, the PVC is bound to the PV. If no suitable PV is available, the PVC remains in a pending state.
  • Once the PVC is bound to a PV, the pod can mount the persistent volume and access it as a filesystem or block device. The pod can read from and write to the volume.

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?...