kubernetes/pkg/controller
Kubernetes Submit Queue cd786bda64
Merge pull request #66863 from cofyc/fix64549
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>.

attachdetach controller: attach volumes immediately when Pod's PVCs are bound

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

Let attachdetach controller to attach volumes immediately when Pod's PVCs are bound.

Current attachdetach controller calls `util.ProcessPodVolume` to add pod volumes into `desiredStateOfWorld` on these events:

- podAdd event
- podUpdate event
- podDelete event
- periodical `desiredStateOfWorldPopulator.findAndAddActivePod`

But if a pod is created with PVCs not bound, no volumes will be added into `desiredStateOfWorld` [because PVCs not bound](https://github.com/kubernetes/kubernetes/blob/v1.12.0-alpha.0/pkg/controller/volume/attachdetach/util/util.go#L99). When pv controller binds PVCs successfully, attachdetach controller will not add pod volumes immediately because it does not watch on PVC events.

It will wait until a pod update event is triggered (normally will not happen because no new status will be reported by kubelet) or `desiredStateOfWorldPopulator.findAndAddActivePod` is called (maybe 0~3 minutes later, see [timer configs](https://github.com/kubernetes/kubernetes/blob/v1.12.0-alpha.0/pkg/controller/volume/attachdetach/attach_detach_controller.go)).

In bad case, pod start time will be very long (~3 minutes + ~2 minutes (kubelet max exponential backoff)), for example: https://github.com/kubernetes/kubernetes/issues/64549#issuecomment-409440546.

**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 #64549

**Special notes for your reviewer**:

**Release note**:

```release-note
attachdetach controller attaches volumes immediately when Pod's PVCs are bound
```
2018-08-14 13:46:35 -07:00
..
bootstrap Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
certificates optimize certificate cleaner 2018-07-12 18:59:03 +08:00
cloud Merge pull request #65052 from dbdd4us/master 2018-07-11 22:25:03 -07:00
clusterroleaggregation Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
cronjob Typo Fix. 2018-06-29 11:04:10 +05:30
daemon ensure ScheduleDSPods respects tainted nodes 2018-08-09 18:01:51 -07:00
deployment Merge pull request #66473 from fisherxu/remove_code 2018-08-03 18:03:04 -07:00
disruption Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
endpoint dup key func 2018-08-03 16:41:23 +08:00
garbagecollector dry-run: Update DynamicClient to pass Create/Update options 2018-08-02 10:38:31 -07:00
history Safe encode template hash value to make it consistent with resource name 2018-07-13 09:52:26 -07:00
job Removed unused functions. 2018-07-22 20:56:53 +08:00
namespace Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
nodeipam Update external k8s.io/metrics imports 2018-07-02 10:44:18 +02:00
nodelifecycle Fix out of bounds error on non-64-bit machines 2018-06-28 16:29:52 -04:00
podautoscaler make the log more readable 2018-08-07 10:00:31 +08:00
podgc add ns info for pod in log 2018-08-01 16:25:34 +08:00
replicaset Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
replication Make conversion function names match expected values 2018-07-17 23:02:16 -04:00
resourcequota Merge pull request #66351 from vikaschoudhary16/fix-scopeselector-exist-operator 2018-08-06 07:13:14 -07:00
route Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
service Implement GetLoadBalancerName per provider and add DefaultLoadBalancerName. 2018-08-04 00:36:48 -04:00
serviceaccount Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
statefulset fix typo: scale dowm-> scale down 2018-08-01 10:39:59 +08: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
util/node Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
volume Merge pull request #66863 from cofyc/fix64549 2018-08-14 13:46:35 -07:00
.import-restrictions add import restrictions 2016-10-13 16:10:24 -07:00
BUILD Safe encode template hash value to make it consistent with resource name 2018-07-13 09:52:26 -07:00
client_builder.go pkg/controller: remove old clientbuilder methods 2018-07-17 09:06:59 -07: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 Safe encode template hash value to make it consistent with resource name 2018-07-13 09:52:26 -07:00
controller_utils_test.go Use apps/v1 in Deployment controller. 2018-05-22 13:42:10 -07:00
doc.go Use Go canonical import paths 2016-07-16 13:48:21 -04:00
lookup_cache.go Use fnv.New32a() in hash instead adler32 2017-02-15 14:03:54 +08:00
OWNERS remove some people from OWNERS so they don't get reviews anymore 2017-07-13 10:02:21 -07:00