Skip to content

Commit

Permalink
Expose storageCluster flag to allow updating of the OSD device classes
Browse files Browse the repository at this point in the history
Earlier the device class of an OSD was determined at provisioning and
it was not possible to update thereafter. In some scenarios the admin
may want to force update the device class to a new value.
To avoid accidental updates, rook requires first setting
allowDeviceClassUpdate in the storage spec of the cephcluster for which
we are exposing a new flag at
Spec.ManagedResources.CephCluster.AllowDeviceClassUpdate.

Signed-off-by: Malay Kumar Parida <[email protected]>
  • Loading branch information
malayparida2000 committed Jul 26, 2024
1 parent 04e80da commit 9602701
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/v1/storagecluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ type ManageCephCluster struct {
// +kubebuilder:validation:Maximum=1.0
// +nullable
BackfillFullRatio *float64 `json:"backfillFullRatio,omitempty"`
// Whether to allow updating the device class after the OSD is initially provisioned
AllowDeviceClassUpdate bool `json:"allowDeviceClassUpdate,omitempty"`
}

// ManageCephConfig defines how to reconcile the Ceph configuration
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/ocs.openshift.io_storageclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ spec:
description: ManageCephCluster defines how to reconcile the Ceph
cluster definition
properties:
allowDeviceClassUpdate:
description: Whether to allow updating the device class after
the OSD is initially provisioned
type: boolean
backfillFullRatio:
description: BackfillFullRatio is the ratio at which the cluster
is too full for backfill. Backfill will be disabled if above
Expand Down
1 change: 1 addition & 0 deletions controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func newCephCluster(sc *ocsv1.StorageCluster, cephImage string, kmsConfigMap *co
Interval: &metav1.Duration{Duration: 30 * time.Second},
},
Storage: rookCephv1.StorageScopeSpec{
AllowDeviceClassUpdate: sc.Spec.ManagedResources.CephCluster.AllowDeviceClassUpdate,
StorageClassDeviceSets: newStorageClassDeviceSets(sc),
FlappingRestartIntervalHours: 24,
FullRatio: sc.Spec.ManagedResources.CephCluster.FullRatio,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ spec:
description: ManageCephCluster defines how to reconcile the Ceph
cluster definition
properties:
allowDeviceClassUpdate:
description: Whether to allow updating the device class after
the OSD is initially provisioned
type: boolean
backfillFullRatio:
description: BackfillFullRatio is the ratio at which the cluster
is too full for backfill. Backfill will be disabled if above
Expand Down
4 changes: 4 additions & 0 deletions deploy/ocs-operator/manifests/storagecluster.crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,10 @@ spec:
description: ManageCephCluster defines how to reconcile the Ceph
cluster definition
properties:
allowDeviceClassUpdate:
description: Whether to allow updating the device class after
the OSD is initially provisioned
type: boolean
backfillFullRatio:
description: BackfillFullRatio is the ratio at which the cluster
is too full for backfill. Backfill will be disabled if above
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9602701

Please sign in to comment.