Creating Storage Classes
In this lesson, we will create the Storage Class defined in the previous lesson and verify it.
We'll cover the following
Creating the Class#
Let’s create our StorageClass.
The output shows that the storageclass "fast"
was created
.
Verification#
We’ll list the StorageClassses in our cluster.
The output is as follows.
We can see that, this time, we have a new StorageClass.
Creating the Deployment#
Let’s take a look at yet another Jenkins definition.
The output, limited to the relevant parts, is as follows.
The only difference, when compared with the previous definition, is that we are now using the newly created StorageClass named fast
.
Finally, we’ll confirm that the new StorageClass works by deploying the new jenkins
definition.
The output is as follows.
Verification#
As the final verification, we’ll list the EBS volumes and confirm that a new one was created based on the new class.
The output, limited to the relevant parts, is as follows.
We can see that the type of the newly created EBS volume is io1
and that it is in-use
.
Sequential Breakdown of the Process#
A simplified version of the flow of events initiated with the creation of the jenkins
Deployment is as follows.
-
We created the
jenkins
Deployment, which created a ReplicaSet, which, in turn, created a Pod. -
The Pod requested persistent storage through the PersistentVolumeClaim.
-
The PersistentVolumeClaim requested PersistentStorage with the StorageClass named
fast
. -
StorageClass
fast
is defined to create a new EBS volume, so it requested one from the AWS API. -
AWS API created a new EBS volume.
-
EBS volume was mounted to the
jenkins
Pod.
We’re finished exploring persistent volumes. You should be equipped with the knowledge how to persist your stateful applications, and the only pending action is to remove the volumes and the cluster.
In the next lesson, we will test our understanding regarding the Persisting State of an application with the help of a quick quiz.