mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
58 lines
1.6 KiB
Plaintext
58 lines
1.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * storage/dynamic-provisioning.adoc
|
|
// * post_installation_configuration/storage-configuration.adoc
|
|
// * microshift_storage/dynamic-provisioning-microshift.adoc
|
|
|
|
|
|
[id="change-default-storage-class_{context}"]
|
|
= Changing the default storage class
|
|
|
|
Use the following process to change the default storage class.
|
|
For example you have two defined storage classes, `gp2` and `standard`, and you want to change the default storage class from `gp2` to `standard`.
|
|
|
|
. List the storage class:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get storageclass
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME TYPE
|
|
gp2 (default) kubernetes.io/aws-ebs <1>
|
|
standard kubernetes.io/aws-ebs
|
|
----
|
|
<1> `(default)` denotes the default storage class.
|
|
|
|
. Change the value of the `storageclass.kubernetes.io/is-default-class` annotation to `false` for the default storage class:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc patch storageclass gp2 -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
|
|
----
|
|
|
|
. Make another storage class the default by setting the `storageclass.kubernetes.io/is-default-class` annotation to `true`:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
|
|
----
|
|
|
|
. Verify the changes:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get storageclass
|
|
----
|
|
+
|
|
.Example output
|
|
[source,terminal]
|
|
----
|
|
NAME TYPE
|
|
gp2 kubernetes.io/aws-ebs
|
|
standard (default) kubernetes.io/aws-ebs
|
|
----
|