kubernetes/test
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
..
cmd kubectl: recreating resources for immutable fields when force is applied 2018-08-09 22:59:02 +08:00
conformance Merge pull request #67084 from spiffxp/rm-conformance-from-e2e_node 2018-08-07 21:06:04 -07:00
e2e Merge pull request #66704 from liangwenguo/comment_error 2018-08-13 11:39:53 -07:00
e2e_kubeadm Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
e2e_node Remove ARCH specific image consideration from e2e tests 2018-08-09 13:40:19 -04:00
fixtures Disable initializers by default 2018-07-10 15:14:32 -04:00
images Merge pull request #67283 from ixdy/update-debian-base 2018-08-10 20:16:55 -07:00
integration Merge pull request #66863 from cofyc/fix64549 2018-08-14 13:46:35 -07:00
kubemark Added check for namespace file 2018-07-31 14:08:04 -04:00
list Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
soak Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
typecheck Deduplicate identical typecheck errors between platforms. 2018-03-28 19:42:48 -07:00
utils Remove ARCH specific image consideration from e2e tests 2018-08-09 13:40:19 -04:00
BUILD move test-cmd guts to separate sig-cli maintained directory 2018-07-05 11:38:26 -04:00
OWNERS Adding rramkumar1 and MrHohn as reviewer & approver to pkg/test 2018-03-21 11:53:18 -07:00
test_owners.csv Remove the Heapster/InfluxDB test 2018-07-13 16:07:33 -04:00
test_owners.json