Set Up Rok Storage Class

This section will guide you through setting Rok storage class as your default storage class.

Important

If you set Rok as your default storage class, applications that request a PVC without specifying the storage class will run on Rok. In case of node failure, you will lose the Rok PVC. Rok will restore the Rok PVC from the latest snapshot, if one exists. However, the restored PVC will not contain data written to it after the latest snapshot. This may or may not be a problem, depending on your application’s replication policy, and its ability to recover a node quickly from a previous snapshot of the data, or after complete loss of a volume.

This part is optional. If you do not wish to set Rok as your default storage class you may proceed to the What’s Next section.

Choose one of the following options to set up Rok as your default storage class:

Option 1: Set Up Rok Storage Class Automatically (preferred)

Choose one of the following options, based on your cloud provider.

Set up Rok as your default storage class by following the on-screen instructions on the rok-deploy user interface.

If rok-deploy is not already running, start it with:

root@rok-tools:~# rok-deploy --run-from storageclass
../../_images/storageclass.png

Proceed to the Summary section.

rok-deploy does not currently support automatic setup of default storage class on Azure Cloud. Please follow the instructions in the Option 2: Set Up Rok Storage Class Manually section to set up Rok as the default storage class manually.
rok-deploy does not currently support automatic setup of default storage class on Google Cloud. Please follow the instructions in the Option 2: Set Up Rok Storage Class Manually section to set up Rok as the default storage class manually.

Option 2: Set Up Rok Storage Class Manually

If you want to set up Rok as your default storage class manually, follow the instructions below.

Procedure

  1. Modify the default storage class. Choose one of the following options, based on your cloud provider:

    root@rok-tools:~# kubectl annotate storageclass gp2 \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=false
    root@rok-tools:~# kubectl annotate storageclass default \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=false
    root@rok-tools:~# kubectl annotate storageclass standard \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=false
  2. Set Rok as the default storage class:

    root@rok-tools:~# kubectl annotate storageclass rok \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=true
  3. Set Rok as the default volume snapshot class:

    root@rok-tools:~# kubectl annotate volumesnapshotclass rok \ > --overwrite \ > snapshot.storage.kubernetes.io/is-default-class=true
  4. Save your state:

    root@rok-tools:~/ops/deployments# rok-j2 deploy/env.storageclass.j2 \ > -o deploy/env.storageclass
  5. Commit your changes:

    root@rok-tools:~/ops/deployments# git commit -am "Set Up Rok Storage Class"
  6. Mark your progress:

    root@rok-tools:~/ops/deployments# export DATE=$(date -u "+%Y-%m-%dT%H.%M.%SZ")
    root@rok-tools:~/ops/deployments# git tag \ > -a deploy/${DATE?}/release-2.0/storageclass \ > -m "Set Up Rok Storage Class"

Verify

  1. Verify that the default storage class has been modified. Choose one of the following options, based on your cloud provider:

    root@rok-tools:~# kubectl get storageclass gp2 \ > -o jsonpath=\ > '{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' false
    root@rok-tools:~# kubectl get storageclass default \ > -o jsonpath=\ > '{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' false
    root@rok-tools:~# kubectl get storageclass standard \ > -o jsonpath=\ > '{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' false
  2. Verify that Rok is the default storage class:

    root@rok-tools:~# kubectl get storageclass rok \ > -o jsonpath='{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' true
  3. Verify that Rok is the default volume snapshot class:

    root@rok-tools:~# kubectl get volumesnapshotclass rok \ > -o jsonpath=\ > '{.metadata.annotations.snapshot\.storage\.kubernetes\.io/is-default-class}{"\n"}' true

Summary

You have successfully set Rok storage class as your default storage class.

What’s Next

The next step is to deploy the Rok Scheduler.