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

mgr: setting balancer mode from cluster spec. #14232

Merged
merged 1 commit into from
May 29, 2024

Conversation

sp98
Copy link
Contributor

@sp98 sp98 commented May 17, 2024

This PR adds a settings option in the Module struct which can help users to futher customize the balancer module with a differet mode.

Testing:
updated the balancer mode to crush-compat.

kubectl exec [POD] [COMMAND] is DEPRECATED and will be removed in a future version. Use kubectl exec [POD] -- [COMMAND] instead.
sh-4.4$ ceph balancer status 
{
    "active": true,
    "last_optimize_duration": "0:00:00.000653",
    "last_optimize_started": "Fri May 17 07:59:01 2024",
    "mode": "crush-compat",
    "no_optimization_needed": false,
    "optimize_result": "Distribution is already perfect",
    "plans": []
}
sh-4.4$ exit

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Reviewed the developer guide on Submitting a Pull Request
  • Pending release notes updated with breaking and/or notable changes for the next minor release.
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.

@sp98 sp98 force-pushed the configure-balancer-mode branch from 8992e33 to 35da748 Compare May 17, 2024 08:04
@sp98 sp98 requested a review from travisn May 17, 2024 13:10
@@ -487,8 +487,12 @@ func (c *Cluster) configureMgrModules() error {

if module.Enabled {
if module.Name == balancerModuleName {
mode := module.Settings.BalancerMode
if mode == "" {
mode = balancerModuleMode
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 renaming that default var?

Suggested change
mode = balancerModuleMode
mode = defaultBalancerModuleMode

pkg/apis/ceph.rook.io/v1/types.go Show resolved Hide resolved
pkg/apis/ceph.rook.io/v1/types.go Show resolved Hide resolved
@sp98 sp98 force-pushed the configure-balancer-mode branch from 35da748 to 942a3b7 Compare May 20, 2024 06:54
@sp98 sp98 requested a review from travisn May 20, 2024 06:54
This PR adds a `settings` option in the `Module` struct
which can help users to futher customize the `balancer`
module with a differet mode.

Signed-off-by: sp98 <[email protected]>
@sp98 sp98 force-pushed the configure-balancer-mode branch from 942a3b7 to 1ad37ec Compare May 29, 2024 04:53
@travisn travisn merged commit 48b6570 into rook:master May 29, 2024
50 of 53 checks passed
travisn added a commit that referenced this pull request May 30, 2024
mgr: setting balancer mode from cluster spec. (backport #14232)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants