Skip to content

Commit 051f546

Browse files
author
Lisa Pettyjohn
committed
OSDOCS-5178:Allow users to create one than one sc
1 parent 7b27f20 commit 051f546

File tree

1 file changed

+27
-7
lines changed

1 file changed

+27
-7
lines changed

modules/dynamic-provisioning-change-default-class.adoc

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,18 @@
88
[id="change-default-storage-class_{context}"]
99
= Changing the default storage class
1010

11-
Use this procedure to change the default storage class.
12-
For example, you have two defined storage classes, `gp3` and `standard`, and you want to change the default storage class from `gp3` to `standard`.
11+
Use the following procedure to change the default storage class.
12+
13+
For example, if you have two defined storage classes, `gp3` and `standard`, and you want to change the default storage class from `gp3` to `standard`.
14+
15+
.Prerequisites
16+
17+
* Access to the cluster with cluster-admin privileges.
1318

1419
.Procedure
1520

21+
To change the default storage class:
22+
1623
. List the storage classes:
1724
+
1825
[source,terminal]
@@ -27,20 +34,33 @@ NAME TYPE
2734
gp3 (default) kubernetes.io/aws-ebs <1>
2835
standard kubernetes.io/aws-ebs
2936
----
30-
<1> `(default)` denotes the default storage class.
37+
<1> `(default)` indicates the default storage class.
3138

32-
. Change the value of the `storageclass.kubernetes.io/is-default-class` annotation to `false` for the default storage class:
39+
. Make the desired storage class the default.
40+
+
41+
For the desired storage class, set the `storageclass.kubernetes.io/is-default-class` annotation to `true` by running the following command:
3342
+
3443
[source,terminal]
3544
----
36-
$ oc patch storageclass gp3 -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
45+
$ oc patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
3746
----
47+
+
48+
[NOTE]
49+
====
50+
You can have multiple default storage classes for a short time. However, you should ensure that only one default storage class exists eventually.
51+
52+
With multiple default storage classes present, any persistent volume claim (PVC) requesting the default storage class (`pvc.spec.storageClassName`=nil) gets the most recently created default storage class, regardless of the default status of that storage class, and the administrator receives an alert in the alerts dashboard that there are multiple default storage classes, `MultipleDefaultStorageClasses`.
53+
54+
// add xref to multi/no default SC module
55+
====
3856

39-
. Make another storage class the default by setting the `storageclass.kubernetes.io/is-default-class` annotation to `true`:
57+
. Remove the default storage class setting from the old default storage class.
58+
+
59+
For the old default storage class, change the value of the `storageclass.kubernetes.io/is-default-class` annotation to `false` by running the following command:
4060
+
4161
[source,terminal]
4262
----
43-
$ oc patch storageclass standard -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'
63+
$ oc patch storageclass gp3 -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "false"}}}'
4464
----
4565

4666
. Verify the changes:

0 commit comments

Comments
 (0)