karmada icon indicating copy to clipboard operation
karmada copied to clipboard

optimize to scheduler some workload with zero replicas

Open LivingCcj opened this issue 8 months ago • 5 comments

What type of PR is this? feature

Which issue(s) this PR fixes: Fixes: #6156 issue 6156

LivingCcj avatar Mar 13 '25 11:03 LivingCcj

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 59.75610% with 33 lines in your changes missing coverage. Please review.

Project coverage is 47.97%. Comparing base (63ad83d) to head (3bb8eb4). Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
pkg/scheduler/scheduler.go 66.21% 17 Missing and 8 partials :warning:
pkg/scheduler/event_handler.go 0.00% 6 Missing and 2 partials :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6203      +/-   ##
==========================================
- Coverage   47.98%   47.97%   -0.01%     
==========================================
  Files         674      674              
  Lines       55855    55903      +48     
==========================================
+ Hits        26802    26820      +18     
- Misses      27307    27327      +20     
- Partials     1746     1756      +10     
Flag Coverage Δ
unittests 47.97% <59.75%> (-0.01%) :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.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

codecov-commenter avatar Mar 13 '25 12:03 codecov-commenter

@LivingCcj The link you provided seems not correct image

zhzhuang-zju avatar Mar 18 '25 08:03 zhzhuang-zju

@LivingCcj The link you provided seems not correct image

Updated that already

LivingCcj avatar Mar 18 '25 08:03 LivingCcj

@LivingCcj I am wondering whether the condition s.isWorkloadByRB(binding) && binding.Spec.Replicas == 0 can effectively intercept workloads with a replica count of zero. Take deployment as example:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nginx
  labels:
    app: nginx
spec:
  replicas: 0
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - image: nginx
        name: nginx

The condition s.isWorkloadByRB(binding) will return false.

zhzhuang-zju avatar Mar 19 '25 02:03 zhzhuang-zju

[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 kevin-wangzefeng for approval. For more information see the Kubernetes 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

karmada-bot avatar Apr 29 '25 12:04 karmada-bot