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

fix(controller): add statefulset gc for podgroup. #3603

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

HalfBuddhist
Copy link

what to fix?

While scheduling a k8s statefulset using volcano, the generated podgroup of the related pods will be in Inqueue state even when setting the replica of the statefulset to zero. And the Inqueued podgroup would still occupy resources, which is not reasonable.

how to reproduce it?

scheduling a statefulset using volcano and scale it to zero.

how to fix in ths pr?

put a informer in controller, delete the pgs for the zero-replica statefulset in the add and the update event.

@volcano-sh-bot
Copy link
Contributor

Welcome @HalfBuddhist!

It looks like this is your first PR to volcano-sh/volcano.

Thank you, and welcome to Volcano. 😃

@volcano-sh-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To complete the pull request process, please assign kevin-wangzefeng
You can assign the PR to them by writing /assign @kevin-wangzefeng in a comment when ready.

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

@volcano-sh-bot volcano-sh-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 17, 2024
@Monokaix
Copy link
Member

Hi, please sign off your commit with git commit -s.
And please note that #3561 has fixed some problems about pg, you can refer it.

Signed-off-by: liuqw <liuqingwei@tecorigin.com>
…e of the statefulset.

Signed-off-by: liuqw <liuqingwei@tecorigin.com>
@HalfBuddhist
Copy link
Author

  1. add sign-off to commit message.
  2. do the same fix in Fix podgroup not created #3561 when rolling upgrade statefulset.

Copy link
Member

@hwdef hwdef left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/ok-to-test

@volcano-sh-bot volcano-sh-bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 24, 2024
@Monokaix
Copy link
Member

Thanks for your contribution ,this case should also be considered: )

}
}

func (pg *pgcontroller) updateStatefulSet(oldObj, newObj interface{}) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is not required

// In this event, need to create PodGroup for the pod.
if *sts.Spec.Replicas > 0 {
selector := metav1.LabelSelector{MatchLabels: sts.Spec.Selector.MatchLabels}
podList, err := pg.kubeClient.CoreV1().Pods(sts.Namespace).List(context.TODO(),
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 use informer list

@Monokaix
Copy link
Member

Thanks for your contribution ,this case should also be considered: )

Please also consider this: #3672

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants