kubernetes/pkg
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
..
api Use OWNERS-based labeling for kind/api-change 2018-08-10 13:48:56 -07:00
apis Use OWNERS-based labeling for kind/api-change 2018-08-10 13:48:56 -07:00
auth Improve multi-authorizer errors 2018-07-06 10:55:17 -04:00
capabilities Autogenerated: hack/update-bazel.sh 2018-02-16 13:43:01 -08:00
client autogenerated 2018-08-09 19:35:03 +03:00
cloudprovider vsphere: enable TestInvalidCaCert 2018-08-11 10:39:20 -07:00
controller Merge pull request #66863 from cofyc/fix64549 2018-08-14 13:46:35 -07:00
credentialprovider fix acr sp access issue 2018-07-20 08:39:31 +00:00
features Merge pull request #67077 from vikaschoudhary16/scope-selectors-beta 2018-08-09 19:31:04 -07:00
fieldpath fieldpath: Add tests for missing cases 2018-07-12 10:26:18 +02:00
generated run "make update" 2018-07-30 15:56:39 +08:00
kubeapiserver node authz/ad externalization 2018-08-09 10:57:30 +08:00
kubectl Merge pull request #67274 from seans3/kubectl-extract-1 2018-08-10 23:19:03 -07:00
kubelet kubelet: plumb context for log requests 2018-08-10 17:35:46 -07:00
kubemark Merge pull request #66284 from stewart-yu/stewart-sharedtype-move 2018-07-30 19:50:36 -07:00
master autogenerated 2018-08-09 19:35:03 +03:00
printers Break annotations with newlines and shorten length 2018-07-31 19:22:50 -04:00
probe Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
proxy Merge pull request #65803 from honkiko/ipvs-add-addrtype-match 2018-08-13 00:28:43 -07:00
quota Merge pull request #66351 from vikaschoudhary16/fix-scopeselector-exist-operator 2018-08-06 07:13:14 -07:00
registry Fix scope.Kind of CONNECT subresources. 2018-08-06 18:59:52 -07:00
routes Remove /ui/ redirect 2018-02-12 10:54:33 -05:00
scheduler Merge pull request #66656 from wackxu/fixappversion 2018-08-11 23:25:33 -07:00
security Cleanup & fix PodSecurityPolicy field path usage 2018-07-18 17:47:32 -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 #64815 from dixudx/hostname_empty 2018-08-03 17:13:32 -07:00
version Set gazelle:importmap_prefix for everything under staging/src 2018-06-22 16:22:57 -07:00
volume Merge pull request #66780 from NetApp/volumeresize 2018-08-14 12:22:00 -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 Add import-boss directives 2017-10-13 07:06:22 -04:00
BUILD Autogenerated stuff 2018-06-27 13:31:10 +02:00
OWNERS