Hello, readers! In this article, we will be focusing on Kubernetes Storage in detail. So, let us begin! 🙂
Table of Contents
What is Kubernetes Storage?
Kubernetes provides us with resources to perform various kinds of operations related to network, service exposure, etc.
When we have our applications being orchestrated through Kubernetes, we would definitely come across the need to have a storage volume wherein we can reside the data from the applications, the necessary time logs, logs of the applications, etc.
Thus, k8 storage provides us with different types of volumes that are persistent in nature to store the data and make it available to be used and interacted with by the application.
In the context of this topic, we would be focusing on the below topics as a part of k8 storage types–
- Persistent Volumes
- Ephemeral Volumes
- Dynamic Provisioning of Volumes
These are the storage spaces available for the data to reside either as a persistent volume or as an ephemeral volume.
To elaborate more on Ephemeral volumes, these kinds of volumes are directly accessible by the containers running within the Kubernetes Pods. It is considered as a directory that can occupy certain data and can be accessed by the containers upon specifying the specification.
2. Persistent Volumes
As discussed above, the volumes accessible to the containers within the pod are ephemeral in nature. Thus, we do not consider it when bulk of data storage comes into picture.
For the same, Kubernetes provides us with Persistent volume storage objects within a cluster which are usually provisioned by the administrator to the applications or namespaces. These storage volumes are similar to the Volume discussed above, but the lifecycle of this storage is independent of the life of the Pod. That is, even if we delete the Pod, the storage remains unaffected and available for use.
To access and use the Persistent Volume over the cluster, we need a Persistent Volume Claim that will help us request for a particular resource of storage. This helps the application teams to analyze and request for the specific size within the persistent volume along with the access modes such as read only, read-write-once, etc.
3. Dynamic Volume Provisioning
As mentioned above, the Kubernetes administrators need to manually manage and create a persistent volume when requested by the application teams or a user.
To reduce this overhead of manual intervention, Dynamic Volume Provisioning comes to our rescue. By this, whenever a user requests for a space or volume, it dynamically provisions the same.
4. Ephemeral Volumes
Ephemeral Volume storage comes along with the Pods. That is, it is the volume space within the pod and it stays as long as the pod lives. The moment the pod restarts or we delete it, all the data vanishes.
Feel free to comment below, in case you come across any question. For more such posts related to Kubernetes and Docker, Stay tuned with us.
Till then, Happy Learning! 🙂