1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/dynamic-provisioning-change-default-class.adoc

57 lines
1.5 KiB
Plaintext

// Module included in the following assemblies:
//
// * storage/dynamic-provisioning.adoc
// * post_installation_configuration/storage-configuration.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
----