You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-scheduling/5278-nominated-node-name-for-expectation/README.md
+17-4Lines changed: 17 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -372,8 +372,7 @@ If an external component adds `NominatedNodeName`, but the scheduler picks up a
372
372
But, if an external component updates `NominatedNodeName` that is set by the scheduler,
373
373
the pod could end up having different `NominatedNodeName` and `NodeName`.
374
374
375
-
We will update the logic so that:
376
-
-`NominatedNodeName` field is cleared during `binding` call
375
+
We will update the logic so that `NominatedNodeName` field is cleared during `binding` call
377
376
378
377
We believe that ensuring that `NominatedNodeName` can't be set after the pod is already bound
379
378
is niche enough feature that doesn't justify an attempt to strenghtening the validation.
@@ -457,10 +456,24 @@ Higher-priority pods can ignore it, but pods with equal or lower priority don't
457
456
This allows us to prioritize nominated pods when nomination was done by external components.
458
457
We just need to ensure that in case when NominatedNodeName was assigned by an external component, this nomination will get reflected in scheduler memory.
459
458
460
-
TODO: We need to ensure that works for non-existing nodes too and if those nodes won't appear in the future, it won't leak the memory.
461
-
462
459
We will implement integration tests simulating the above behavior of external components.
463
460
461
+
### The scheduler's cache for `NominatedNodeName`
462
+
463
+
Here, we'll ensure that works for non-existing nodes too and if those nodes won't appear in the future, it won't leak the memory.
464
+
465
+
The scheduler stores `NominatedNodeName` data at [`nominator`](https://github.com/kubernetes/kubernetes/blob/master/pkg/scheduler/backend/queue/nominator.go).
466
+
This `nominator` holds `NominatedNodeName` data even if the node doesn't exist.
467
+
So, this caching mechanism should work correctly for non-existing NNN node scenario.
This `deletePodFromSchedulingQueue` is called when unscheduled pods are removed,
472
+
or pods are assigned to nodes (EventHandler calls `DeleteFunc` handler when [the condition](https://github.com/kubernetes/kubernetes/blob/b2dfba4151b859c31a27fe31f8703f9b2b758270/pkg/scheduler/eventhandlers.go#L416) is no longer met).
473
+
474
+
So, as a conclusion, there should be nothing to implement newly around it.
475
+
Again, we'll ensure this scenario works correctly via tests.
476
+
464
477
#### The scheduler only modifies `NominatedNodeName`, not clears it in any cases
465
478
466
479
As of now, scheduler clears the `NominatedNodeName` field at the end of failed scheduling cycle if it
0 commit comments