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

Commit a2566de

Browse files
committed
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. Signed-off-by: Blaine Gardner <[email protected]>
1 parent a052b89 commit a2566de

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: apis/objectstorage/v1alpha2/types.go

+20
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package v1alpha2
1818

1919
import (
2020
corev1 "k8s.io/api/core/v1"
21+
"k8s.io/apimachinery/pkg/api/resource"
2122
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2223
)
2324

@@ -203,12 +204,31 @@ type BucketClass struct {
203204
// +kubebuilder:default:=Retain
204205
DeletionPolicy DeletionPolicy `json:"deletionPolicy"`
205206

207+
// Quotas defines optional quotas applied to all buckets created from this Bucket Class.
208+
// +optional
209+
Quotas BucketQuotas `json:"quotas,omitempty"`
210+
206211
// Parameters is an opaque map for passing in configuration to a driver
207212
// for creating the bucket
208213
// +optional
209214
Parameters map[string]string `json:"parameters,omitempty"`
210215
}
211216

217+
type BucketQuotas struct {
218+
// MaxObjects specifies the maximum number of objects that will be allowed in a bucket.
219+
// +optional
220+
// +nullable
221+
MaxObjects *uint64 `json:"maxObjects"`
222+
223+
// MaxSize specifies the maximum allowed size counting all objects in the bucket. This parameter
224+
// should not be assumed to be a hard limit. Most object storage providers are only able to
225+
// check the total size of a bucket periodically, and high-bandwidth bucket writes may allow the
226+
// total size to surpass the limit by some margin.
227+
// +optional
228+
// +nullable
229+
MaxSize *resource.Quantity `json:"maxSize"`
230+
}
231+
212232
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
213233
type BucketClassList struct {
214234
metav1.TypeMeta `json:",inline"`

0 commit comments

Comments
 (0)