Comments (14)
brain dump:
So the documentation says -
// The scheduler will prefer to schedule pods to nodes that satisfy
// the affinity expressions specified by this field, but it may choose
// a node that violates one or more of the expressions. The node that is
// most preferred is the one with the greatest sum of weights, i.e.
// for each node that meets all of the scheduling requirements (resource
// request, requiredDuringScheduling affinity expressions, etc.),
// compute a sum by iterating through the elements of this field and adding
// "weight" to the sum if the node matches the corresponding matchExpressions; the
// node(s) with the highest sum are the most preferred.
// +optional
PreferredDuringSchedulingIgnoredDuringExecution []PreferredSchedulingTerm `json:"preferredDuringSchedulingIgnoredDuringExecution,omitempty" protobuf:"bytes,2,rep,name=preferredDuringSchedulingIgnoredDuringExecution"`
IIUC, the pod is scheduled on the node with the maximum calculated weight. The weight that is specified in the nodeAffinity is added to the pre-calculated weight and then the pod is scheduled.
So, in order to evict a pod, we need to calculate weights of the nodes where the pod can fit (based on nodeAffinity rules), and if a node gets a weight more than the weight of the current node then evict the pod.
WDYT about the approach @ravisantoshgudimetla @aveshagarwal?
from descheduler.
I believe @ravisantoshgudimetla and @aveshagarwal are the right folks for that ;)
from descheduler.
@containscafeine I'd say first address requiredDuringSchedulingIgnoredDuringExecution (hard affinity) than preferredDuringSchedulingIgnoredDuringExecution (soft affinity).
For pods with node affinity set using preferredDuringSchedulingIgnoredDuringExecution, it might be possible that the preferred node was unavailable during scheduling and the pod was scheduled on another node. In this case, if the descheduler is run, it does the following -
It's not just about initial scheduling, as during initial scheduling, the scheduler makes its best effort to fulfill a pod's requirements. Infact it's more about what happens over time (changes in a cluster) that may lead to violation of requirements since these requirements are not checked at run time.
from descheduler.
@aveshagarwal a bit confused on how to handle requiredDuringSchedulingIgnoredDuringExecution
, since the key says anyway that we need to ignore during execution.
Let's say the labels on the current node have changed during runtime and the affinity rules are not met anymore, then should we evict that pod, since it explicitly says to ignore during execution. What am I missing? :(
from descheduler.
@aveshagarwal a bit confused on how to handle requiredDuringSchedulingIgnoredDuringExecution, since the key says anyway that we need to ignore during execution.
Let's say the labels on the current node have changed during runtime and the affinity rules are not met anymore, then should we evict that pod,
Yes.
since it explicitly says to ignore during execution. What am I missing? :(
So it says "ignored" that means the scheduler does not take care of that. And that is something we can take care of in descheduler.
from descheduler.
requiredDuringSchedulingIgnoredDuringExecution
was merged in #56
Will now implement preferredDuringSchedulingIgnoredDuringExecution
from descheduler.
ping @ravisantoshgudimetla @aveshagarwal
from descheduler.
Hey @containscafeine,
are you still working on this feature, would be really a helpful feature.
from descheduler.
@nitishkumar71 unfortunately I don't have bandwidth to work on this right now, sorry about that.
from descheduler.
@containscafeine No worries, can you point me to direction so I can understand codebase. I can give it a try.
from descheduler.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale
from descheduler.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
from descheduler.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
from descheduler.
@fejta-bot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity.
Reopen the issue with/reopen
.
Mark the issue as fresh with/remove-lifecycle rotten
.Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close
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/test-infra repository.
from descheduler.
Related Issues (20)
- RemoveDuplicates does not working with azure aks 1.26.6 HOT 1
- Kubernetes 1.29 Release HOT 1
- 1.29: Update version references in docs and readme HOT 1
- Bump Kubernetes dependencies to v1.29.0 HOT 1
- 1.29: Update CI in test-infra HOT 1
- Create v0.29.0 tag on master HOT 1
- Promote v0.29.0 docker image HOT 1
- Helm chart version update to v0.29.0 HOT 1
- Cut release-1.29 branch HOT 1
- Publish v0.29.0 GitHub release HOT 1
- Email sig mailing list HOT 1
- Should we upgrade go version to 1.21? HOT 1
- Fix code scanning alert - ssh: Prefix truncation attack on Binary Packet Protocol (BPP) HOT 1
- Scraping Metrics from a CronJob HOT 6
- Kustomize template ref=v0.29.0 references to 0.28.1 HOT 1
- Deprecate CronJob deployment approach HOT 2
- Pods strategies don't work HOT 7
- IMDSv2
- Strategy RemovePodsViolatingNodeAffinity does not remove pod when affinity disappears HOT 1
- Single node clusters support HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from descheduler.