1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/dynamic-provisioning-change-default-class.adoc
Steven Smith 858ec7700b 4
2022-12-15 20:24:36 +00:00

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
----