Skip to content

Commit 74ffdce

Browse files
authored
Merge pull request #48200 from iheartNathan/42288-Inconsistent-documentation-of-default-StorageClass
fix inconsistency in documentation of default storageclass
2 parents f9d1ec1 + 4e3523c commit 74ffdce

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

‎content/en/docs/reference/access-authn-authz/admission-controllers.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,12 @@ and automatically adds a default storage class to them.
209209
This way, users that do not request any special storage class do not need to care about them at all and they
210210
will get the default one.
211211

212-
This admission controller does not do anything when no default storage class is configured. When more than one storage
213-
class is marked as default, it rejects any creation of `PersistentVolumeClaim` with an error and an administrator
214-
must revisit their `StorageClass` objects and mark only one as default.
212+
This admission controller does nothing when no default `StorageClass` exists. When more than one storage
213+
class is marked as default, and you then create a `PersistentVolumeClaim` with no `storageClassName` set,
214+
Kubernetes uses the most recently created default `StorageClass`.
215+
When a `PersistentVolumeClaim` is created with a specified `volumeName`, it remains in a pending state
216+
if the static volume's `storageClassName` does not match the `storageClassName` on the `PersistentVolumeClaim`
217+
after any default StorageClass is applied to it.
215218
This admission controller ignores any `PersistentVolumeClaim` updates; it acts only on creation.
216219

217220
See [persistent volume](/docs/concepts/storage/persistent-volumes/) documentation about persistent volume claims and

‎content/en/docs/tasks/administer-cluster/change-default-storage-class.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,13 @@ for details about addon manager and how to disable individual addons.
7373
kubectl patch storageclass gold -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'
7474
```
7575

76-
Please note that at most one StorageClass can be marked as default. If two
77-
or more of them are marked as default, a `PersistentVolumeClaim` without
78-
`storageClassName` explicitly specified cannot be created.
76+
Please note you can have multiple `StorageClass` marked as default. If more
77+
than one `StorageClass` is marked as default, a `PersistentVolumeClaim` without
78+
an explicitly defined `storageClassName` will be created using the most recently
79+
created default `StorageClass`.
80+
When a `PersistentVolumeClaim` is created with a specified `volumeName`, it remains
81+
in a pending state if the static volume's `storageClassName` does not match the
82+
`StorageClass` on the `PersistentVolumeClaim`.
7983

8084
1. Verify that your chosen StorageClass is default:
8185

0 commit comments

Comments
 (0)