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

koord-scheduler: check if reservation port match the pod #908

Merged

Conversation

KunWuLuan
Copy link
Contributor

Signed-off-by: KunWuLuan kunwuluan@gmail.com

Increase the judgment on port when judging whether the pod matches the reservation.

Now koordinator only judge on resource and owners when judging whether the pod matches the reservation. And remove the ports according to the pods' requirement. (https://github.com/koordinator-sh/koordinator/blob/main/pkg/scheduler/plugins/reservation/hook.go#L240)

By the implementation, reserve ports are created by all reservations on node, so the pod may remove the ports which are reserved by more than one reservation.

If a pod requires ports which are reserved by more than one reservation and its resource requirement can be satisfied by one of the reservations, the pod can be bind to the node. Then this pod will use the ports that are reserved by other reservations, which will cause the port conflicts with the other pods.

For example, reservation A reserve 100m cpu, 100Mi mem and port 1000, reservation B reserve 1000m cpu and 1000Mi mem. Now a pod which require 1000m cpu and 1000Mi mem with port 1000 can pass the filter. In this case the pod will be bound to reservation B. Then the pod who requires 100m cpu, 100Mi mem and port 1000 can still pass the filter. And it will have port conflict with the previous pod.

Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
@codecov
Copy link

codecov bot commented Dec 28, 2022

Codecov Report

Base: 66.63% // Head: 66.63% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (df48044) compared to base (0a02d28).
Patch coverage: 72.72% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #908      +/-   ##
==========================================
- Coverage   66.63%   66.63%   -0.01%     
==========================================
  Files         238      238              
  Lines       27675    27726      +51     
==========================================
+ Hits        18442    18475      +33     
- Misses       7965     7983      +18     
  Partials     1268     1268              
Flag Coverage Δ
unittests 66.63% <72.72%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/scheduler/plugins/reservation/utils.go 79.27% <72.72%> (-0.35%) ⬇️
pkg/koordlet/runtimehooks/reconciler/reconciler.go 61.76% <0.00%> (-4.12%) ⬇️
pkg/koordlet/statesinformer/states_pods.go 51.65% <0.00%> (-1.99%) ⬇️
pkg/scheduler/plugins/reservation/rcache.go 89.16% <0.00%> (+0.09%) ⬆️
pkg/scheduler/plugins/reservation/hook.go 79.16% <0.00%> (+0.63%) ⬆️
pkg/scheduler/plugins/coscheduling/core/gang.go 75.39% <0.00%> (+0.94%) ⬆️
...dlet/statesinformer/states_noderesourcetopology.go 64.55% <0.00%> (+1.29%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@eahydra eahydra changed the title check if reservation port match the pod koord-scheduler: check if reservation port match the pod Dec 29, 2022
Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
@koordinator-bot koordinator-bot bot added size/L and removed size/S labels Dec 29, 2022
@KunWuLuan KunWuLuan requested review from saintube and removed request for eahydra and buptcozy December 29, 2022 07:44
Copy link
Member

@eahydra eahydra left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@koordinator-bot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eahydra

The full list of commands accepted by this bot can be found here.

The pull request process is described 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

@koordinator-bot koordinator-bot bot merged commit b275d4c into koordinator-sh:main Dec 29, 2022
FillZpp pushed a commit that referenced this pull request Jan 16, 2023
Signed-off-by: KunWuLuan <kunwuluan@gmail.com>
lucming pushed a commit to lucming/koordinator that referenced this pull request Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants