Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring more than one default StorageClass #49331

Open
museg27 opened this issue Jan 7, 2025 · 7 comments
Open

Declaring more than one default StorageClass #49331

museg27 opened this issue Jan 7, 2025 · 7 comments
Assignees
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/storage Categorizes an issue or PR as relevant to SIG Storage.

Comments

@museg27
Copy link

museg27 commented Jan 7, 2025

Hi!
There is discrepancies in the documentation for behavior of creating a PersistentVolumeClaim when declaring more than one default StorageClass :

in
https://kubernetes.io/docs/tasks/administer-cluster/change-default-storage-class/#changing-the-default-storageclass

"Please note that at most one StorageClass can be marked as default. If two or more of them are marked as default, a PersistentVolumeClaim without storageClassName explicitly specified cannot be created."

and
https://kubernetes.io/docs/concepts/storage/storage-classes/#default-storageclass

"If you set the storageclass.kubernetes.io/is-default-class annotation to true on more than one StorageClass in your cluster, and you then create a PersistentVolumeClaim with no storageClassName set, Kubernetes uses the most recently created default StorageClass."

Thank you.

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG Docs takes a lead on issue triage for this website, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jan 7, 2025
@thisisharrsh
Copy link
Contributor

/language en
/sig docs

@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. labels Jan 8, 2025
@thisisharrsh
Copy link
Contributor

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jan 8, 2025
@thisisharrsh
Copy link
Contributor

master_node $ kubectl describe pvc test-pvc
Name:          test-pvc
Namespace:     default
StorageClass:  default-class-two
Status:        Pending
Volume:        
Labels:        <none>
Annotations:   <none>
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      
Access Modes:  
VolumeMode:    Filesystem
Used By:       <none>
Events:
  Type    Reason                Age               From                         Message
  ----    ------                ----              ----                         -------
  Normal  WaitForFirstConsumer  4s (x2 over 15s)  persistentvolume-controller  waiting for first consumer to be created before binding

Based on the output, the StorageClass default-class-two was selected for the test-pvc, confirming that Kubernetes chose the most recently created default StorageClass.

@thisisharrsh
Copy link
Contributor

I believe we should change the current documentation in the Changing the default StorageClass to:
If two or more StorageClasses are marked as default, Kubernetes uses the most recently created default StorageClass for PersistentVolumeClaims without a specified storageClassName.

@thisisharrsh
Copy link
Contributor

I would to like to work on this issue.
/assign

@iheartNathan
Copy link
Contributor

#48200 was created to fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language/en Issues or PRs related to English language needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/storage Categorizes an issue or PR as relevant to SIG Storage.
Projects
None yet
Development

No branches or pull requests

4 participants