k3s/pkg
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
..
api dry-run: Create new options for Update/Create and pass it along 2018-07-12 07:18:37 -07:00
apis Merge pull request #66047 from krunaljain/bugfix/csi_default_fs_type 2018-07-10 18:45:32 -07:00
auth Improve multi-authorizer errors 2018-07-06 10:55:17 -04:00
capabilities
client clean up node expansion 2018-07-10 11:01:15 +08:00
cloudprovider Merge pull request #66007 from w-leads/bugfix/vcp-missing-vmuuid 2018-07-12 10:14:03 -07:00
controller Merge pull request #66120 from CaoShuFeng/csr_deny 2018-07-12 15:14:20 -07:00
credentialprovider Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
features Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
fieldpath fieldpath: Add tests for missing cases 2018-07-12 10:26:18 +02:00
generated Generate pkg/generated/bindata.go 2018-07-09 11:38:05 -07:00
kubeapiserver kube-apiserver: disallow --secure-port 0 2018-07-09 14:03:08 +02:00
kubectl make delete waits match on UID 2018-07-12 14:48:13 -04:00
kubelet Merge pull request #65594 from liggitt/node-csr-addresses-2 2018-07-11 22:25:07 -07:00
kubemark Remove unused io util writer & volume host GetWriter() 2018-07-09 14:09:48 -07:00
master dry-run: Create new options for Update/Create and pass it along 2018-07-12 07:18:37 -07:00
printers Merge pull request #65351 from dtaniwaki/fix-deletion-timestamp-printing 2018-07-09 20:39:10 -07:00
probe Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
proxy Merge pull request #65425 from islinwb/ipvs_cleanup_rules 2018-07-12 15:14:16 -07:00
quota only need to ignore resources that match discovery conditions 2018-07-05 10:29:58 -04:00
registry dry-run: Create new options for Update/Create and pass it along 2018-07-12 07:18:37 -07:00
routes
scheduler Merge pull request #65745 from silveryfu/image-locality-scoring 2018-07-12 17:57:16 -07:00
security Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
securitycontext Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
serviceaccount fix a nit error in log 2018-06-27 14:21:27 +08:00
ssh Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
util Merge pull request #65594 from liggitt/node-csr-addresses-2 2018-07-11 22:25:07 -07:00
version Set gazelle:importmap_prefix for everything under staging/src 2018-06-22 16:22:57 -07:00
volume Merge pull request #65649 from rsc/fix-printf 2018-07-11 14:09:08 -07:00
watch/json Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
windows/service Update to gazelle 0.12.0 and run hack/update-bazel.sh 2018-06-22 16:22:18 -07:00
.import-restrictions
BUILD Autogenerated stuff 2018-06-27 13:31:10 +02:00
OWNERS