-
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.
81d56d9
to
2c6af46
Compare
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.
3d3f124
to
37a903a
Compare
37a903a
to
af79440
Compare
8a65924
to
aa2e535
Compare
aa2e535
to
2e96803
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: parth-gr, travisn 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 |
078d10c
to
ed54a83
Compare
New changes are detected. LGTM label has been removed. |
ed54a83
to
8570f10
Compare
8570f10
to
9af1d44
Compare
9af1d44
to
e28237a
Compare
f764483
to
0746a48
Compare
// LastExpansionStartTime is the time stamp of the last run start of the storage scaling | ||
// +optional | ||
LastExpansionStartTime metav1.Time `json:"lastExpansionStartTime,omitempty"` | ||
// LastExpansionCompletionTime is the time stamp of the last run completion of the storage scaling | ||
// +optional | ||
LastExpansionCompletionTime metav1.Time `json:"lastExpansionCompletionTime,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.
I'd suggest asking @nb-ohad and @iamniting whether they think these time fields should be pointers/nullable so that the output doesn't include the epoch date-time when time is equal to 0.
// LastExpansionStartTime is the time stamp of the last run start of the storage scaling | |
// +optional | |
LastExpansionStartTime metav1.Time `json:"lastExpansionStartTime,omitempty"` | |
// LastExpansionCompletionTime is the time stamp of the last run completion of the storage scaling | |
// +optional | |
LastExpansionCompletionTime metav1.Time `json:"lastExpansionCompletionTime,omitempty"` | |
// LastExpansionStartTime is the time stamp of the last run start of the storage scaling | |
// +optional | |
// +nullable | |
LastExpansionStartTime *metav1.Time `json:"lastExpansionStartTime,omitempty"` | |
// LastExpansionCompletionTime is the time stamp of the last run completion of the storage scaling | |
// +optional | |
// +nullable | |
LastExpansionCompletionTime *metav1.Time `json:"lastExpansionCompletionTime,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.
Its already see we used without pointer in lot of places where we report heartbeat, so not a concern for now, can discuss this async.
api/v1/storage_autoscaler.go
Outdated
// Phase describes the Phase of StorageAutoScaler | ||
// +kubebuilder:validation:Enum="";'NotStarted;InProgress;Failed;Succeeded | ||
Phase StorageAutoScalerPhase `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.
I think a previous note I added as a reply got missed. It'd be best to not enum the phase. This can only introduce errors creating the CRD, and I don't know of any resources that enum status items like this.
For comparison the StorageCluster status phase isn't enum-ed
ocs-operator/api/v1/storagecluster_types.go
Lines 545 to 548 in be77c56
// Phase describes the Phase of StorageCluster | |
// This is used by OLM UI to provide status information | |
// to the user | |
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.
why cant we use enum with +optional
or + nullable
?
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 had a better way,
+kubebuilder:default="NotStarted"
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 not sure if we can use enum with nullable, since nullable implies a type that is a pointer. It might be valid or might not. But in general, I don't think enums in status items are very helpful. In my experience, they are unlikely to help and likely to cause a problem, so don't bother. They won't help users, since users don't set the status themselves. Also, they can result in the operator being unable to set otherwise valid statuses, resulting in unexpected runtime errors that we need to bug fix.
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.
Actually I removed +nullable, and used a default value,
The main reason here is to use enum is that coming from alert team, as alert are based on the phase they had to make sure operator is setting up correctly
api/v1/storage_autoscaler.go
Outdated
// The start storage capacity is the original storage capacity of the OSDs before the expansion in progress is completed. | ||
// After the expansion is completed, this would be updated to the expected storage capacity. | ||
// +optional | ||
StartStorageCapacity resource.Quantity `json:"startStorageCapacity,omitempty"` | ||
// The Expected storage capacity is the storage capacity that the auto-expansion has decided to set. | ||
// This will be set on the storageCluster CR as the desired storage capacity of the OSDs. | ||
// +optional | ||
ExpectedStorageCapacity resource.Quantity `json:"expectedStorageCapacity,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.
I'm curious what benefit this gives us over StartOsdSize
and ExpectedOsdSize
. I think those are the things that actually control whether expansion will continue or not right?
Doesn't this have room for calculation errors between Ceph's reported total capacity and the PV/PVC capacity?
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.
we have to use these values with the alerts, #3045 (comment)
0746a48
to
05db935
Compare
added a new crd for automatic storage scaling Signed-off-by: parth-gr <[email protected]>
05db935
to
2e4e617
Compare
/retest |
added a new crd for automatic storage scaling