Commit Graph

7 Commits (5e9a3adafc4be3de649616ede0b0b6b08b056359)

Author SHA1 Message Date
Bobby (Babak) Salamat a5045d107e Add NodeTree to the scheduler cache 2018-08-17 09:56:51 -07:00
Kubernetes Submit Queue b883f4cff8
Merge pull request #65745 from silveryfu/image-locality-scoring
Automatic merge from submit-queue (batch tested with PRs 66011, 66111, 66106, 66039, 65745). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

Enable adaptive scoring in ImageLocalityPriority

**What this PR does / why we need it**:

This PR replaces the original, pure image-size based scoring to an adaptive scoring scheme. The new scoring scheme considers not only the image size but also its `"spread" `- the definition of `"spread"` is described in what follows: 

> Given an image`i`, `spread_i = num_node_has_i / total_num_nodes`  

And the image receives the score: `score_i = size_i * spread_i`, as proposed by @resouer. The final node score is the summation of image scores for all images found existing on the node that are mentioned in the pod spec.

The goal of this heuristic is to better _balance image locality with other scheduling policies_. In particular, it aims to mitigate and prevent the undesirable "node heating problem", _i.e._, pods get assigned to the same or a few nodes due to preferred image locality. Given an image, the larger `spread` it has the more image locality we can consider for it - since we can expect more nodes having this image.

The new image state information in scheduler cache, enabled in this PR, allows other potential heuristics to be explored.

**Special notes for your reviewer**:

@resouer 

Additional unit tests are WIP. 

**Release note**:

```release-note
NONE
```
2018-07-12 17:57:16 -07:00
Silvery Fu c3f111f74a Add image states to scheduler cache 2018-07-11 23:58:02 -07:00
Kubernetes Submit Queue f2db955b9d
Merge pull request #64363 from idealhack/sub-benchmarks/scheduler/schedulercache
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

scheduler: update tests to use sub-benchmarks (pkg/scheduler/cache)

**What this PR does / why we need it**:

Go 1.7 added the subtest feature which can make table-driven tests much easier to run and debug. Some tests are not using this feature.

Further reading: [Using Subtests and Sub-benchmarks](https://blog.golang.org/subtests)

/kind cleanup

**Release note**:

```release-note
NONE
```
2018-07-01 19:04:19 -07:00
Yang Li d7e12ce453 scheduler: update tests to use sub-benchmarks (pkg/scheduler/cache) 2018-07-01 00:51:42 +08:00
AdoHe 6116c64f64 keep pod state consistent when UpdatePod 2018-06-06 21:13:12 +08:00
Guoliang Wang 761cf41427 Move pkg/scheduler/schedulercache -> pkg/scheduler/cache 2018-05-31 22:55:34 +08:00