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

Bug: When using PodToDelete along with decreasing replicas, the priority should consider PodToDelete list #269

Open
wu8685 opened this issue Sep 6, 2024 · 1 comment
Assignees
Labels
kind/bug Something isn't working

Comments

@wu8685
Copy link
Collaborator

wu8685 commented Sep 6, 2024

Minimal reproduce step

Scale in 2 pods, along with more than 2, let's say 3 podToDelete.

What did you expect to see?

2 Pods from podToDelete list should be delete with scale-in label, and 1 Pod should be recreated.

What did you see instead

The deletion priority may not consider PodToDelete list.
https://github.com/KusionStack/kuperator/blob/v0.5.3/pkg/controllers/collaset/synccontrol/sync_control.go#L403

What is your KusionStack components and its version?

0.5.0

@wu8685 wu8685 added the kind/bug Something isn't working label Sep 6, 2024
@ColdsteelRail
Copy link
Member

ColdsteelRail commented Sep 7, 2024

In fact, it works as expected now, as following:
(1) for pods in podToDelete list, we mark the podWrapper.toDelete=true, otherwise false:

(2) then we sort and assign toDelete=true pods with highest priority in getPodsToDelete(),:

if l.ToDelete != r.ToDelete {

As a result:

  • for pods in podToDelete list but out of replicas, they will be scaled in
  • for pod in podToDelete list, and in range of replicas, they will be recreate d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants