Creating Storage Classes

In this lesson, we will create the Storage Class defined in the previous lesson and verify it.

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.

The sequence of events initiated with a request to create a Jenkins Pod with the PersistentVolumeClaim using a custom StorageClass
The sequence of events initiated with a request to create a Jenkins Pod with the PersistentVolumeClaim using a custom StorageClass
  1. We created the jenkins Deployment, which created a ReplicaSet, which, in turn, created a Pod.

  2. The Pod requested persistent storage through the PersistentVolumeClaim.

  3. The PersistentVolumeClaim requested PersistentStorage with the StorageClass named fast.

  4. StorageClass fast is defined to create a new EBS volume, so it requested one from the AWS API.

  5. AWS API created a new EBS volume.

  6. 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.

Defining Storage Classes
Quick Quiz!
Mark as Completed
Report an Issue