Introduction to Kubernetes Persistent Volumes
The Kubernetes persistent volumes are defined as, it is a section of the repository in the cluster which has been equipped by an administrator by using the repository classes, it is assets in the cluster such as node which is also an asset in the cluster, they are volumes plugins like volumes but they have a lifecycle which can be liberated of any individual pod and that can use the persistent volumes, it is commonly used for databases in Kubernetes because the database want to approach its data at all time by supporting the persistent volume in which it can be attached to the pod.
What are Kubernetes persistent volumes?
In Kubernetes, the word PersistentVolume mention for storage of assets which can be designed to help us to control the storage of our applications, the assets of the persistent storage elements belong to the cluster and it goes independently to the pod, the persistent volume is the section of network storage that has been scaled by the administrator which has resources in the cluster that is independent of any separate pod which can use the persistent volume.
Kubernetes persistent volumes lifecycle
The lifecycle of the persistent volume has been started at provisioning, pass to the binding that is followed by using, and then it can transfer to reclaiming, retaining, and finally deletion. It has some steps in its lifecycle let us discuss as follows,
Provisioning: It has static provisioning and dynamic provisioning.
Binding: It is the process that makes sure that the persistent volume can fulfill the users demand without wasting volume assets.
Using: It can fulfill the demands in which the cluster can scale only a bound volume for a pod.
Reclaiming: The cluster can avail the reclaim policy which can grow what to do with volume after its claim is released.
Kubernetes types of volumes: The Kubernetes volume is like a directory that can be accessible to the container in a pod and it has various types as given below,
When a pod has been allocated to a node then the emptyDir volume has been generated in which if the pod is running on the node then it may be working for a long time, in this case at first the volume is empty at the beginning and the container will read and write the file and when the pod is taken out then the data has also been deleted from the emptyDir.
- hostPath: This volume can able to scale a file or directory from the filesystem of the node.
- gcePersistentDisk: This type of volume can scale the persistent disk of Google Compute Engine into our pod and the whole data from this volume can be carried when a pod has been deleted from the node.
- awsElasticBlockStore: This volume has been organizes the amazon Wb Services Elastic Block store into our pod same as GCE persistent disk, the complete data in this volume remains undamaged when the pod has been deleted from node.
- nfs: The NFS stands for Network File System which can organize into our pod and the data from it has been removed when the pod is taken out from the node and the volume only gets down.
- iscsi: The ISCSI volume allows to existing volume SCSI over IP volume to be set into our pod.
- flocker: This volume has been used to control the data volumes which is open-source in which it allows a dataset of it to organize in our pod, if the dataset does not survive in the flocker then we need to generate it by using the API of flocker.
- glusterfs: It is the open-source network filesystem that allows the glusterfs to be arranged into our pod.
- rbd: It stands for Rados Block Device which allows being launched into our pod and the data has been maintained after the pod has been deleted from the node.
- cephfs: It allows the existing volume of it to be launched into our pod, and the data has been carried to put on after when the pod is deleted from the node.
- gitRepo: It launches an empty directory and creates a duplicate git repository into it to be used by our pod.
- secret: This type of volume has been used to pass the delicate data like passwords to the pod.
- azureDiskVolume: It is used to scale a Microsoft Azure Data Disk into a pod.
Kubernetes persistent types of volumes
The Kubernetes persistent types are executed as plugins in which some are given as follows,
- AWS elastic block store
- Azure Disk
- Azure file
- CephFS volume
- Container storage interface
- Fibre channel storage
- Flex volume
- GCE persistent disk
- Glusterfs volume
- Hostpath volume
- Local storage
- Network filesystem storage
- Portworx volume
- Rados block device
- Vsphere VMDK volume
- Flocker storage
- Quobyte volume
- StorageOS volume
Kubernetes persistent volumes – Use protection
In the production environment like database services it needs to access the highest available data storage, Kubernetes gives a lot of flexibility when it comes to persistent data storage in which every compound can use the particular mechanism for data storage.
Kubernetes persistent – Retained, Recycled, and Deleted
- Retained: The ‘retain’ is a reclaim policy that allows for manual reclamation of the assets, when the persistent volume chain has been deleted then the PV quite exists.
- Recycled: It is a reclaim policy that executes a basic scrub on the volume and makes it accessible again for a new claim if the administrator can construct a custom recycler pod template by using the controller manager command-line argument.
- Deleted: This is a reclaim policy in which the plugins have been supported by it which can delete the objects from Kubernetes.
In this article we conclude that the Kubernetes persistent volume is a segment of network storage that has been equipped by the administrator, we have also discussed the type of volumes, the lifecycle of Kubernetes persistent volume, and hence this article will help to understand the concept of persistent volumes in Kubernetes.
This is a guide to Kubernetes Persistent Volumes. Here we discuss the Kubernetes persistent volume is a segment of network storage that has been equipped by the administrator. You may also have a look at the following articles to learn more –