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

autoscaling: add new crd for automatic storage scaling #3044

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

parth-gr
Copy link
Member

added a new crd for automatic storage scaling

@parth-gr
Copy link
Member Author

Please review the new CRD
/assign @BlaineEXE @malayparida2000 @iamniting @nb-ohad @malayparida2000

@parth-gr
Copy link
Member Author

/retest

@iamniting iamniting self-requested a review February 18, 2025 15:32
Copy link
Member

@iamniting iamniting left a 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.

Copy link
Contributor

openshift-ci bot commented Feb 18, 2025

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: parth-gr
Once this PR has been reviewed and has the lgtm label, please ask for approval from iamniting. For more information see the 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

@parth-gr parth-gr force-pushed the auto-storage-crd branch 2 times, most recently from 81d56d9 to 2c6af46 Compare February 18, 2025 16:04
@parth-gr parth-gr requested a review from iamniting February 18, 2025 16:07
format: date-time
type: string
phase:
description: Phase describes the Phase of AutoStorageScaling

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 ?

Copy link
Member Author

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?

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

Copy link
Member Author

@parth-gr parth-gr Feb 19, 2025

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

@parth-gr parth-gr requested a review from alfonsomthd February 19, 2025 08:02
Copy link
Member

@Madhu-1 Madhu-1 left a comment

Choose a reason for hiding this comment

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

// +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.
Copy link
Member

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.

Choose a reason for hiding this comment

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

+1

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated

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"`
Copy link
Member

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

Copy link
Member Author

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

Copy link
Contributor

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?

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.

Copy link
Member

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.

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?

Copy link
Member

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.

// 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"`
Copy link
Member

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?

// AutoStorageScalingStatus defines the observed state of AutoStorageScaling
type AutoStorageScalingStatus struct {
// Phase describes the Phase of AutoStorageScaling
Phase string `json:"phase,omitempty"`
Copy link
Member

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?

// 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"`
Copy link
Member

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?

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.
Copy link
Member

Choose a reason for hiding this comment

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

storageCLuster to storageCluster

@@ -0,0 +1,75 @@
/*
Copyright 2020 Red Hat OpenShift Container Storage.
Copy link
Member

Choose a reason for hiding this comment

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

2025?

// +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.
Copy link
Member

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

added a new crd for automatic  storage scaling

Signed-off-by: parth-gr <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants