-
Notifications
You must be signed in to change notification settings - Fork 40.9k
KEP 5325 - Improve pod selection accuracy across workload types #132628
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
base: master
Are you sure you want to change the base?
Conversation
This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: omerap12 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 |
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
Signed-off-by: Omer Aplatony <[email protected]>
afde280
to
e0f0de6
Compare
controllerCache := NewControllerCache(dynamicClient, mapper, 15*time.Minute, m) // TODO: should this be configurable? | ||
go controllerCache.Start(ctx, 30*time.Minute) // TODO: should this be configurable? |
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.
For reviewers.
|
||
func (f *OwnerReferencesFilter) Filter(pods []*v1.Pod) ([]*v1.Pod, []*v1.Pod, error) { | ||
if f.Cache == nil { | ||
return nil, nil, fmt.Errorf("cache is required for OwnerReferencesFilter") // TODO: how to handle this? |
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.
For reviewers.
isOwned, err := f.isPodOwnedByTarget(pod, *targetRef, namespace) | ||
if err != nil { | ||
// On error, assume pod is not owned | ||
// TODO: is this how to handle this? |
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.
For reviewers.
|
||
// isPodOwnedByTarget checks if a pod is owned by the target reference by traversing the ownership chain | ||
func (f *OwnerReferencesFilter) isPodOwnedByTarget(pod *v1.Pod, targetRef autoscalingv2.CrossVersionObjectReference, namespace string) (bool, error) { | ||
const maxOwnershipChainLength = 10 // TODO: should we make this configurable? |
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.
For reviewers.
if nextOwner == nil { | ||
nextOwner, err = f.Cache.GetResource(namespace, ownerRef) | ||
if err != nil { | ||
continue // TODO: what should we do here? |
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.
For reviewers.
@omerap12: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/remove-sig api-machinery |
cc @kubernetes/sig-autoscaling-leads |
What type of PR is this?
/kind feature
/kind api-change
What this PR does / why we need it:
HPA : Improve pod selection accuracy across workload types
Which issue(s) this PR is related to:
KEP: kubernetes/enhancements#5325
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: