-
Notifications
You must be signed in to change notification settings - Fork 964
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
base: master
Are you sure you want to change the base?
Conversation
Welcome @HalfBuddhist! |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Hi, please sign off your commit with |
Signed-off-by: liuqw <liuqingwei@tecorigin.com>
78e452a
to
5301d8a
Compare
…e of the statefulset. Signed-off-by: liuqw <liuqingwei@tecorigin.com>
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
Thanks for your contribution ,this case should also be considered: ) |
} | ||
} | ||
|
||
func (pg *pgcontroller) updateStatefulSet(oldObj, newObj interface{}) { |
There was a problem hiding this comment.
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(), |
There was a problem hiding this comment.
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
Please also consider this: #3672 |
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.