Skip to content
This repository was archived by the owner on Dec 6, 2024. It is now read-only.

Create v1alpha2 with bucket quotas #66

Conversation

BlaineEXE
Copy link
Contributor

Copy v1alpha1 -> v1alpha2 with no changes. Then...

Add optional quotas to BucketClass:
Focus initially on quotas applied to all buckets created from a
BucketClass. This means that a storage admin may specify limits that
apply to every user of the BucketClass. Users do not have self-service
control over bucket quotas beyond their ability to select amongst some
number of BucketClasses.

This makes no changes to the spec except to appropriately modify the
version name.

Signed-off-by: Blaine Gardner <[email protected]>
Focus initially on quotas applied to all buckets created from a
BucketClass. This means that a storage admin may specify limits that
apply to every user of the BucketClass. Users do not have self-service
control over bucket quotas beyond their ability to select amongst some
number of BucketClasses.

Signed-off-by: Blaine Gardner <[email protected]>
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 24, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @BlaineEXE!

It looks like this is your first PR to kubernetes-sigs/container-object-storage-interface-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/container-object-storage-interface-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BlaineEXE
Once this PR has been reviewed and has the lgtm label, please assign jsafrane for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 24, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @BlaineEXE. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 24, 2023
@BlaineEXE
Copy link
Contributor Author

Because this creates v1alpha2, it looks like a lot of changes as a whole. But the 2nd commit shows the actual extent, which is currently quite small.

a2566de

I don't foresee this being finished yet, but I want to start having initial conversations before addressing things like Bucket status items showing what quotas are in place.

@xing-yang
Copy link
Contributor

/hold

This needs more design discussions before merging.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 24, 2023
Copy link
Contributor

@thotz thotz left a comment

Choose a reason for hiding this comment

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

Any plans to tie up with https://kubernetes.io/docs/concepts/policy/resource-quotas/#storage-resource-quota like PVCs and storageclasses


// Quotas defines optional quotas applied to all buckets created from this Bucket Class.
// +optional
Quotas BucketQuotas `json:"quotas,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO the BucketClass should have quota based on no of buckets as well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that something that can be controlled via Kubernetes RBAC?

Copy link
Contributor Author

@BlaineEXE BlaineEXE Sep 7, 2023

Choose a reason for hiding this comment

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

I believe, based on Xing's input, the appropriate way for admins to limit the number of buckets that users can request is via resource quotas. To my understanding, this would allow admins can limit the number of BucketRequests that users or service accounts are allowed to create, and that would then limit the number of buckets in the backend.

It seems best to me to use Kubernetes authorization and quota mechanisms as much as possible so that COSI is not implementing unnecessary complexity. This follows the school of thought that systems are generally easier for users to configure when there is only a single means of accomplishing any given goal.

I do think the suggestion is a relevant point and germane to the discussion. I think we should clarifying in the COSI design how admins are intended to limit the number of buckets themselves.

// Parameters is an opaque map for passing in configuration to a driver
// for granting access to a bucket
// +optional
Parameters map[string]string `json:"parameters,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

There should be some sort of quota offering in BucketAccessClass as well to restrict users, say if the same bucket is shared among different users which has a limit of 10Gb. If one user consumes 9Gb and otherone will have only 1Gb access remaining

Copy link
Contributor Author

@BlaineEXE BlaineEXE Sep 7, 2023

Choose a reason for hiding this comment

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

This design is specifically only for bucket quotas. Rook users have given feedback that they want bucket quotas, but they seem to not have strong desires for access/user-level quotas right now. Given that, and in the interest of making small, incremental changes, I have intentionally omitted BucketAccess quotas from the proposal.

@xing-yang
Copy link
Contributor

@BlaineEXE Can you work on a design doc as this is a new feature?

@xing-yang
Copy link
Contributor

In Kubernetes, there is a way to specify the number of CRs. Maybe that is useful as well. See an example here: https://github.com/kubernetes-csi/external-snapshotter#setting-quota-limits-with-snapshot-custom-resources

@BlaineEXE
Copy link
Contributor Author

BlaineEXE commented Sep 7, 2023

Closing this after discussion today. Likely, there is no need for v1alpha2. We can add changes to the v1alpha1 types freely (unlike beta/stable).

Can you work on a design doc as this is a new feature?
I have formally started the design doc process by opening a KEP issue here: kubernetes/enhancements#4194

@BlaineEXE
Copy link
Contributor Author

Closing this, as likely a v1alpha2 won't be proposed, instead opting to modify the v1alpha1 api as allowed by "alpha" state.

@BlaineEXE BlaineEXE closed this Sep 15, 2023
BlaineEXE pushed a commit to BlaineEXE/cosi-api that referenced this pull request May 29, 2024
shanduur pushed a commit to shanduur/container-object-storage-interface-api that referenced this pull request Jun 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants