Challenge, Medium,  on  Kubernetes

Create an OpenEBS StorageClass and Set It as the Default

Scenario

OpenEBS is installed on the cluster. You need to create a custom StorageClass that uses OpenEBS local provisioning and make it the default StorageClass for the cluster.

The existing default StorageClass local-path must no longer be marked as default — a cluster should have only one default StorageClass.

The manifest file must be saved at:

/home/laborant/openebs-local-sc.yaml

Task

  1. Create a StorageClass named openebs-local with the following configuration and save the manifest at /home/laborant/openebs-local-sc.yaml:
    FieldValue
    provisioneropenebs.io/local
    volumeBindingModeWaitForFirstConsumer
    reclaimPolicyDelete
    allowVolumeExpansiontrue
  2. After applying the manifest, make openebs-local the new default StorageClass and remove the default annotation from local-path.

Hint 1

Use kubectl annotate storageclass to set or remove the storageclass.kubernetes.io/is-default-class annotation.

Alternatively, use kubectl patch storageclass to add or update the annotation via a merge patch, which is useful for automation or scripting.

To set as default use storageclass.kubernetes.io/is-default-class=true and to remove use storageclass.kubernetes.io/is-default-class-.

See the official docs:


Test Cases