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

Fix storageclass pvc statement #42177

Merged
merged 1 commit into from
Aug 17, 2023

Conversation

Affan-7
Copy link
Contributor

@Affan-7 Affan-7 commented Jul 24, 2023

This fixes #42176

Here is what I did:
Screenshot from 2023-07-31 20-16-10

I created two default storage classes. And applied the following manifest file for creating a PVC with no explicit 'storageClassName' attribute.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 3Gi

The PVC got bound with the newest storageclass(local-storage).

Here is a reference: kubernetes/kubernetes#110559

Admission control plugin "DefaultStorageClass": If more than one StorageClass is designated as default (via the "storageclass.kubernetes.io/is-default-class" annotation), choose the newest one instead of throwing an error.

@k8s-ci-robot k8s-ci-robot requested review from saad-ali and thockin July 24, 2023 16:55
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jul 24, 2023
@netlify
Copy link

netlify bot commented Jul 24, 2023

Pull request preview available for checking

Built without sensitive environment variables

Name Link
🔨 Latest commit 84ce0f1
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-io-main-staging/deploys/64c7ceb30146ef0008af4c27
😎 Deploy Preview https://deploy-preview-42177--kubernetes-io-main-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sftim
Copy link
Contributor

sftim commented Jul 24, 2023

/sig storage

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jul 24, 2023
@Affan-7 Affan-7 force-pushed the storageclass-pvc-statement branch from 883e4f0 to 05af8f1 Compare July 31, 2023 14:52
@Affan-7 Affan-7 force-pushed the storageclass-pvc-statement branch from 05af8f1 to 84ce0f1 Compare July 31, 2023 15:09
@Affan-7
Copy link
Contributor Author

Affan-7 commented Jul 31, 2023

Hi @sftim, can you please review this.

@tengqm
Copy link
Contributor

tengqm commented Aug 1, 2023

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tengqm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 1, 2023
@Affan-7
Copy link
Contributor Author

Affan-7 commented Aug 2, 2023

/auto-cc

@k8s-ci-robot k8s-ci-robot requested a review from xing-yang August 2, 2023 12:06
@Affan-7
Copy link
Contributor Author

Affan-7 commented Aug 3, 2023

/approve

Can you add lgtm @tengqm

@tengqm
Copy link
Contributor

tengqm commented Aug 3, 2023

@Affan-7 I intentionally left the technical LGTM to others. I'm aware of this behavior difference and the related change, but I do believe a technical LGTM is desirable.

@Nuru
Copy link

Nuru commented Aug 5, 2023

It may be beyond the expertise (or simply time budget) of the OP to amend this PR as I am requesting, but I believe this page in particular needs significant changes with respect to the DefaultStorageClass admission controller. In particular, it is now enabled by default in all currently supported versions of Kubernetes, so statements such as:

To enable dynamic storage provisioning based on storage class, the cluster administrator needs to enable the DefaultStorageClass admission controller on the API server.

Is misleading at best, because the cluster administrator does not need to do anything to enable the admission controller.

Several other sections documenting the difference between having the DefaultStorageClass admission controller enabled and disabled should be rewritten to reflect the default status of it being enabled.

@sftim
Copy link
Contributor

sftim commented Aug 6, 2023

It may be beyond the expertise (or simply time budget) of the OP to amend this PR as I am requesting, but I believe this page in particular needs significant changes with respect to the DefaultStorageClass admission controller. In particular, it is now enabled by default in all currently supported versions of Kubernetes, so statements such as:

To enable dynamic storage provisioning based on storage class, the cluster administrator needs to enable the DefaultStorageClass admission controller on the API server.

Is misleading at best, because the cluster administrator does not need to do anything to enable the admission controller.

Several other sections documenting the difference between having the DefaultStorageClass admission controller enabled and disabled should be rewritten to reflect the default status of it being enabled.

Would you be willing to open an issue about that shortcoming @Nuru?

@Nuru
Copy link

Nuru commented Aug 6, 2023

@sftim wrote

Would you be willing to open an issue about that shortcoming @Nuru?

Opened #42413

@sftim

This comment was marked as resolved.

@sftim
Copy link
Contributor

sftim commented Aug 15, 2023

@Affan-7 if #42551 merges, you can link to the new section about StorageClass defaults (and simplify the concept page about persistent volumes).

all PVCs.
cluster responds to PVC creation as if the admission plugin were turned off. If more than one
default StorageClass is specified, the newest default is used when the
PVC is dynamically provisioned.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RomanBednar @jsafrane Can you verify this? Based on this PR https://github.com/kubernetes/kubernetes/pull/117064/files, it is not always the newest.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it will be very rare / impossible that two StorageClasses have the same CreationTimestamp. IMO the sentence is good enough for users.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^^ Agreed, chances to hit that condition is very low.

@sftim
Copy link
Contributor

sftim commented Aug 17, 2023

based on #42177 (comment)

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 17, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8a12def215f05a4aee9de39d16ab35639613423c

@k8s-ci-robot k8s-ci-robot merged commit 1c4a01d into kubernetes:main Aug 17, 2023
@Affan-7 Affan-7 deleted the storageclass-pvc-statement branch September 2, 2023 09:53
@sftim
Copy link
Contributor

sftim commented Jan 29, 2024

Oops, this incorrectly marked #42176 as fixed. Sorry about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/docs Categorizes an issue or PR as relevant to SIG Docs. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconsistencies in default StorageClass behaviour in "Storage Classes" and "Persistent Volumes" pages
8 participants