Hello and welcome to this lecture on persistent volumes.
My name is Mumshad Mannambeth in the last lecture.
We learned about volumes.
Now we will discuss Persistent Volumes in Kubernetes. When we created volumes in the previous section
We configured volumes within the pod definition file so every configuration information required to
configure storage for the volume goes within the pod definition file.
Now when you have a large environment with a lot of users deploying a lot of pods the users would have
to configure storage every time for each pod.
Whatever storage solution is used the users who deploys the pods would have to configure that on all
pod definition files in his own environment every time it changes to be made.
The user would have to make them on all of his pods.
Instead you would like to manage storage more centrally.
You would like it to be configured in a way that an administrator can create a large pool of storage
and then have users carve out pieces from it has required.
That is where persistent volumes can help us.
A persistent volume is a cluster wide pool of storage volumes configured by an administrator to be used
by users deploying applications on the Cluster.
The users can now select storage from this pool using persistent volume claims let us now create a persistent
volume.
We start with the base template and update the API version set the client to persistent volume and
name it pv-vol1 under the specs section specify the access modes access mode defines how
a volume should be mounted on the hosts whether in a read only mode or read write mode etc. The supported
values are read only.
Many read write ones or read write many next is the capacity specify the amount of storage to be reserved
for this persistent volume which is set to 1 GB here.
Next comes the volume type.
We will start with the host path option that uses storage from the nodes local directory.
Remember this option is not to be used in a production environment.
To create the volume run kubectrl
Create command and to list the created volume.
Run the kubectrl get persistent in volume command replace the host.
Path option with one of the supported storage solutions as we saw in the previous lecture like AWS elastic
blocks store etc well that's it on persistent volumes.
In this lecture in the next lecture we will look at how we use persistent volume claims to claim the
volume configured with persistent volumes.