-
Notifications
You must be signed in to change notification settings - Fork 262
feat: Add PreferencePolicy
as an environment variable option
#2122
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
feat: Add PreferencePolicy
as an environment variable option
#2122
Conversation
Skipping CI for Draft Pull Request. |
2987580
to
6e45b76
Compare
6e45b76
to
c352a7a
Compare
Pull Request Test Coverage Report for Build 14392176282Details
💛 - Coveralls |
44ffb28
to
38f54bd
Compare
38f54bd
to
df49000
Compare
19fa576
to
a1143d7
Compare
PreferencePolicy
as an environment variable option
a1143d7
to
046062a
Compare
046062a
to
16414c2
Compare
a2e8196
to
255a4f8
Compare
255a4f8
to
21cde66
Compare
21cde66
to
d221aff
Compare
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.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jonathan-innis, rschalo 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 |
Fixes #N/A
Description
This change adds an environment variable option called
PreferencePolicy
with the following definitions:Respect
: Karpenter will attempt to respect all preferences as requirements. If Karpenter cannot simulate pods against the node given these requirements, it will begin removing preferences from the pod until it is able to schedule the pod.Respect
can also block consolidation more frequently due to the way that the preference relaxation ordering is orchestrated.Ignore
: Karpenter will ignore all preferences when it performs its scheduling simulations. In general, this is a more efficient way to run Karpenter because Karpenter will have to give less effort to satisfying all of the preferences on the application pods. In addition, it's currently not guaranteed that even if Karpenter does respect all of the preferences, then they will still be respected by the kube-scheduler. In particular, when considering things likepreferredDuringSchedulingIgnoredDuringExecution
anti-affinity preferences andScheduleAnyways
topologySpreadConstraints, it's very timing-dependent and non-deterministic on whether or not the kube-scheduler will see the pods in time to respect the preferences.CI Benchmark Testing Results
Scale Testing
I validated this change by creating a testing workload that had a preference that was unsatisfiable and therefore would have to be relaxed with
PreferencePolicy=Respect
. By settingPreferencePolicy=Ignore
, we wouldn't capture these preferences in our cluster topology or consider it when adding pods to nodes.Test Workload
PreferencePolicy=Respect
(19m)PreferencePolicy=Ignore
(7m)How was this change tested?
make presubmit
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.