peter (admin)   -  



 

HostPath Storage vs Dynamic Provisioning

Here we will learn the difference between using HostPath storage, where we manually create and manage storage, and dynamic provisioning, where Kubernetes automatically creates and assigns storage when a request is made.

What Is HostPath Storage?

HostPath is a type of storage in Kubernetes where we use a folder from the actual node machine's disk and connect it directly to a pod. This means the data is stored on the local system of that node.

In simple words, it is like using your computer's folder as storage for your application.

For example, if we define a path like /mnt/data in a HostPath volume, Kubernetes will use that exact folder from the node and store data there.

If a pod writes data, it will be saved in that location on the node.

This is simple and useful for testing, but it has a limitation. Because the data is tied to that specific node, if the pod moves to another node, it will not have access to that data.

What Is Dynamic Provisioning?

Dynamic provisioning means Kubernetes automatically creates storage when a request is made through a PersistentVolumeClaim (PVC), without us manually creating a PersistentVolume (PV).

This works using a StorageClass, which defines how the storage should be created.

Main Difference

The main difference is that with HostPath, we manually define and manage the storage, and it is limited to a specific node.

With dynamic provisioning, Kubernetes automatically creates and manages storage for us, making it easier to scale and more suitable for real-world environments.

Previous Lectures

We covered HostPath, or manual storage, in the lectures on PersistentVolumeClaims and using persistent storage in pods. In those lectures, we created the storage ourselves, requested it, and then used it inside a pod to store and verify data.

In those lectures, we learned how to define and manage storage manually, step by step.

We then covered dynamic provisioning in the StorageClasses lecture, where Kubernetes automatically created and assigned storage when we made a request using a PVC.

In that lecture, we also learned how the system handles storage without manually creating a PersistentVolume.

Summary

This lecture is a summary to help you understand the difference between manual and automatic storage, and how both approaches work in real scenarios.

 


Comments (0)

There are no comments yet. Be the first to comment.

Log in or register to leave a comment. all comments are subject to admin approval