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.
Fast Forward
If you have already set up Rok as your default storage class, expand this box to fast-forward.
- Proceed to the Verify 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).
- Option 2: Set Up Rok Storage Class Manually.
Overview
What You’ll Need¶
- A configured management environment.
- An existing Rok deployment.
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:
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¶
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=falseroot@rok-tools:~# kubectl annotate storageclass default \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=falseroot@rok-tools:~# kubectl annotate storageclass standard \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=falseSet Rok as the default storage class:
root@rok-tools:~# kubectl annotate storageclass rok \ > --overwrite \ > storageclass.kubernetes.io/is-default-class=trueSet Rok as the default volume snapshot class:
root@rok-tools:~# kubectl annotate volumesnapshotclass rok \ > --overwrite \ > snapshot.storage.kubernetes.io/is-default-class=true
Verify¶
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"}' falseroot@rok-tools:~# kubectl get storageclass default \ > -o jsonpath=\ > '{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' falseroot@rok-tools:~# kubectl get storageclass standard \ > -o jsonpath=\ > '{.metadata.annotations.storageclass\.kubernetes\.io/is-default-class}{"\n"}' falseVerify 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"}' trueVerify 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