Creating a Storage Class in Microsoft Azure

Introduction

Azure volumes can be:

  • Azure Disks

  • Azure Files

  • Azure NetApp Files

  • Azure Blobs.

To provide a PersistentVolume, you can use only:

As noted in the Volumesarrow-up-right section, the choice of Disks or Files is often determined by the need for concurrent access to the data or the performance tier.

Prerequisites

Steps to create Disk and Network Volumes

The main focus of the next steps is preparing your cluster to support Disk Volumes.

1. Create a file named csi_rwo.yaml.

2. Copy and paste the content below into the csi_rwo.yaml file:

circle-info

The complete list of valid SKU types is available on the Microsoft documentation websitearrow-up-right.

3. Save the file and exit from edit mode

4. Apply the file to Kubernetes using the following command:

Testing the Storage Class

1. Create a file named claim_rwo.yaml and paste the content below inside it.

2. Apply the claim:

3. Now it's time to create a pod that uses the claim. Create a new file named pod.yaml and paste the content below inside it:

4. Apply the file

5. Make sure everything worked out:

6. Now let's check if the pod is running:

7. Cleanup the resources:

circle-info

The volume type disk will be automatically provisioned by Azure using the defined storage class.

Last updated

Was this helpful?