karmada
karmada copied to clipboard
karmadactl support rebalance command to trigger a fresh rescheduling
What type of PR is this?
/kind feature
What this PR does / why we need it:
karmadactl support rebalance command to trigger a fresh rescheduling
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
karmadactl support rebalance command to trigger a fresh rescheduling
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please assign lonelycz for approval. For more information see the Kubernetes Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
test report:
$ karmadactl rebalance -h
Actively triggerring a fresh rescheduling, which disregards the previous assignment entirely and seeks to establish an
entirely new replica distribution across clusters.
Examples:
# Rebalance deployment(default/nginx)
karmadactl rebalance deployment nginx -n default
# Rebalance deployment(default/nginx) with gvk
karmadactl rebalance deployment.v1.apps nginx -n default
Options:
--dry-run=false:
Run the command in dry-run mode, without making any server requests.
--karmada-context='':
The name of the kubeconfig context to use
--kubeconfig='':
Path to the kubeconfig file to use for CLI requests.
-n, --namespace='':
If present, the namespace scope for this CLI request
Usage:
karmadactl rebalance <RESOURCE_TYPE> <RESOURCE_NAME> -n <NAME_SPACE> [options]
Use "karmadactl options" for a list of global command-line options (applies to all commands).
$ karmadactl rebalance deployment nginx
successfully rebalance Deployment default/nginx
$ karmadactl rebalance deployment.v1.apps nginx
successfully rebalance Deployment default/nginx
$ karmadactl rebalance deployment nginxxx
error: failed to get resource in Karmada. err: the deployment or nginxxx don't exist in Karmada
:warning: Please install the to ensure uploads and comments are reliably processed by Codecov.
Codecov Report
Attention: Patch coverage is 0% with 134 lines in your changes missing coverage. Please review.
Project coverage is 42.90%. Comparing base (
ed3f48c) to head (ec0acfd).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| pkg/karmadactl/rebalance/rebalance.go | 0.00% | 133 Missing :warning: |
| pkg/karmadactl/karmadactl.go | 0.00% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## master #5471 +/- ##
==========================================
- Coverage 43.00% 42.90% -0.11%
==========================================
Files 656 657 +1
Lines 55921 56055 +134
==========================================
+ Hits 24051 24052 +1
- Misses 30324 30457 +133
Partials 1546 1546
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 42.90% <0.00%> (-0.11%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Is there any further comments? If anyone has other suggestions, please let me know~
Is there any further comments? If anyone has other suggestions, please let me know~
all comments fixed @zhzhuang-zju
/lgtm assign @RainbowMango
@RainbowMango can this PR bring to release-1.12 ?
I'm not sure if I have enough bandwidth. Will see.