-
Notifications
You must be signed in to change notification settings - Fork 185
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
autoscaling: add new crd for automatic storage scaling #3044
base: main
Are you sure you want to change the base?
Conversation
Please review the new CRD |
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you pls add all generated changes? Pls look at the failed github action for more details.
084a1ed
to
b4f8f5c
Compare
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: parth-gr 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 |
81d56d9
to
2c6af46
Compare
format: date-time | ||
type: string | ||
phase: | ||
description: Phase describes the Phase of AutoStorageScaling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parth-gr Shouldn't we describe the enum
allowed values: waiting,inProgress,completed,failed
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its the controller that would be updating the status values, so I don't think we need enum here, wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, it's not strictly necessary. My suggestion intended to have a more descriptive explanation for users just like the StorageCluster
CRD does for deviceType
:
deviceType:
description: |-
DeviceType is the value of device type in
this StorageDeviceSet. It can have one of the
three values (SSD, HDD, NVMe)
enum:
- SSD
- ssd
- HDD
- hdd
- NVMe
- NVME
- nvme
type: string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, with constant
And validation using enum
PS: plus its a status spec so user should not be updating it, so its just to fine to keep the checks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CRD need to be added to https://github.com/red-hat-storage/ocs-operator/blob/main/PROJECT as well.
api/v1/autostoragescale.go
Outdated
// +kubebuilder:printcolumn:name="LastRunTimeStamp",type=date,JSONPath=.status.lastRunTimeStamp,description="Last Run Time Stamp" | ||
// +operator-sdk:csv:customresourcedefinitions:displayName="Auto Storage Scaling" | ||
|
||
// AutoStorageScaling represents the automatic storage scaling for odf cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about calling it as StorageAutoScaling
or StorageAutoScaler
? because keeping Storage in the front aligns with the idea that we are trying to scale storage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
api/v1/autostoragescale.go
Outdated
StorageClusterName string `json:"storageClusterName,omitempty"` | ||
// DeviceClassName is the name of the device class for which the storage scaling is to be done. | ||
// +kubebuilder:validation:Required | ||
DeviceClassName string `json:"deviceClassName,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why deviceClass is required? AFAIK its optional in the storagecluster creation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its optionally but ocs operator alwyas add ssd
if not provided by storagecluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused though. The autoscaler should be autoscaling existing storageclassdevicesets, and the device class should be able to be read from the scDeviceSet being scaled, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still confused though. The autoscaler should be autoscaling existing storageclassdevicesets, and the device class should be able to be read from the scDeviceSet being scaled, right?
AFAIK autoscaling will apply to the devicesets of a particular deviceclass, so we need to know the deviceclass in order to filter devicesets by deviceclass.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During creation its an optional it should be kept optional as well, if its not specified we should treat it the same way we do during creation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
During creation its an optional it should be kept optional as well, if its not specified we should treat it the same way we do during creation.
You mean that if not specified it should default to ssd
like StorageCluster
CR, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes correct whatever ocs-operator chooses during storagecluster creation.
api/v1/autostoragescale.go
Outdated
// The known size is the original size of the OSDs before the expansion in progress is completed. | ||
// After the expansion is completed, this would be updated to the expected OSD size. | ||
// Used for vertical scaling of OSDs. | ||
KnownOsdSize resource.Quantity `json:"knownOsdSize,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of KnownOsdISize
does it make sense to keep this as currentOsdSize
?
api/v1/autostoragescale.go
Outdated
// AutoStorageScalingStatus defines the observed state of AutoStorageScaling | ||
type AutoStorageScalingStatus struct { | ||
// Phase describes the Phase of AutoStorageScaling | ||
Phase string `json:"phase,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we please define a known Phase const of it?
api/v1/autostoragescale.go
Outdated
// The known OSD count is the original count of the OSDs before the expansion in progress is completed. | ||
// After the expansion is completed, this would be updated to the expected OSD count. | ||
// Used for horizontal scaling of OSDs. | ||
KnownOsdCount int32 `json:"knownOsdCount,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here as well. and also do we need it to be int32? or just use uint16?
api/v1/autostoragescale.go
Outdated
KnownOsdCount int32 `json:"knownOsdCount,omitempty"` | ||
// The Expected OSD count is the count that the auto-expansion has decided to set. | ||
// This will be set on the storageCLuster CR as the desired count of the OSDs. | ||
// Used for horizontal scaling of OSDs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
storageCLuster
to storageCluster
api/v1/autostoragescale.go
Outdated
@@ -0,0 +1,75 @@ | |||
/* | |||
Copyright 2020 Red Hat OpenShift Container Storage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025?
api/v1/autostoragescale.go
Outdated
// +kubebuilder:printcolumn:name="LastRunTimeStamp",type=date,JSONPath=.status.lastRunTimeStamp,description="Last Run Time Stamp" | ||
// +operator-sdk:csv:customresourcedefinitions:displayName="Auto Storage Scaling" | ||
|
||
// AutoStorageScaling represents the automatic storage scaling for odf cluster. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odf cluster.
to storage cluster
2c6af46
to
3d3f124
Compare
added a new crd for automatic storage scaling Signed-off-by: parth-gr <[email protected]>
3d3f124
to
37a903a
Compare
added a new crd for automatic storage scaling