k3s/pkg/controller
Kubernetes Submit Queue 2fdd328d05
Merge pull request #67556 from msau42/fix-assume
Automatic merge from submit-queue (batch tested with PRs 67709, 67556). If you want to cherry-pick this change to another branch, please follow the instructions here: https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md.

Fix volume scheduling issue with pod affinity and anti-affinity

**What this PR does / why we need it**:
The previous design of the volume scheduler had volume assume + bind done before pod assume + bind.  This causes issues when trying to evaluate future pods with pod affinity/anti-affinity because the pod has not been assumed while the volumes have been decided.

This PR changes the design so that volume and pod are assumed first, followed by volume and pod binding.  Volume binding waits (asynchronously) for the operations to complete or error. This eliminates the subsequent passes through the scheduler to wait for volume binding to complete (although pod events or resyncs may still cause the pod to run through scheduling while binding is still in progress).   This design also aligns better with the scheduler framework design, so will make it easier to migrate in the future.

Many changes had to be made in the volume scheduler to handle this new design, mostly around:
* How we cache pending binding operations.  Now, any delayed binding PVC that is not fully bound must have a cached binding operation.  This also means bind API updates may be repeated.
* Waiting for the bind operation to fully complete, and detecting failure conditions to abort the bind and retry scheduling.

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #65131

**Special notes for your reviewer**:

**Release note**:

```release-note
Fixes issue where pod scheduling may fail when using local PVs and pod affinity and anti-affinity without the default StatefulSet OrderedReady pod management policy
```
2018-09-04 23:19:37 -07:00
..
apis/config Autogen 2018-09-04 14:21:14 -07:00
bootstrap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
certificates UT case of certificate_controller 2018-07-14 16:40:08 +08:00
cloud Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
clusterroleaggregation Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cronjob Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
daemon Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
deployment Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
disruption Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
endpoint K8s SCTP support implementation for the first pull request 2018-08-27 05:56:27 +00:00
garbagecollector Add sig/api-machinery label to apimachinery OWNERS files 2018-08-20 18:46:47 +05:30
history Merge pull request #67485 from linyouchong/pr-0816 2018-08-21 21:10:05 -07:00
job Merge pull request #66085 from liggitt/updatejob 2018-08-27 17:40:54 -07:00
namespace Add sig/api-machinery label to apimachinery OWNERS files 2018-08-20 18:46:47 +05:30
nodeipam Merge pull request #68135 from shyamjvs/add-random-backoff-to-cidr-allocator 2018-09-03 18:41:40 -07:00
nodelifecycle Taint node in paralle. 2018-09-01 09:57:02 +08:00
podautoscaler Replace scale down forbidden window 2018-08-31 20:24:38 +02:00
podgc add ns info for pod in log 2018-08-01 16:25:34 +08:00
replicaset Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
replication Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
resourcequota allow failed discovery on initial quota controller start 2018-08-17 11:42:54 -04:00
route Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
service K8s SCTP support implementation for the first pull request 2018-08-27 05:56:27 +00:00
serviceaccount Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
statefulset Add Labels to various OWNERS files 2018-08-21 13:59:08 -04:00
testutil Merge pull request #65052 from dbdd4us/master 2018-07-11 22:25:03 -07:00
ttl Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
ttlafterfinished Add TTL GC controller 2018-09-04 13:11:18 -07:00
util/node Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
volume Merge pull request #67556 from msau42/fix-assume 2018-09-04 23:19:37 -07:00
.import-restrictions
BUILD Add TTL GC controller 2018-09-04 13:11:18 -07:00
OWNERS
client_builder.go Deprecate ListWatchUntil, fix it and call places 2018-08-15 13:34:31 +02:00
controller_ref_manager.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
controller_ref_manager_test.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
controller_utils.go controller expectations for deletion can be met by 404 2018-08-24 09:03:51 -04:00
controller_utils_test.go controller expectations for deletion can be met by 404 2018-08-24 09:03:51 -04:00
doc.go
lookup_cache.go