mirror of
https://github.com/kubernetes/kubernetes.git
synced 2026-02-18 10:18:14 -05:00
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 ``` |
||
|---|---|---|
| .. | ||
| bootstrap | ||
| certificates | ||
| cloud | ||
| clusterroleaggregation | ||
| cronjob | ||
| daemon | ||
| deployment | ||
| disruption | ||
| endpoint | ||
| garbagecollector | ||
| history | ||
| job | ||
| namespace | ||
| nodeipam | ||
| nodelifecycle | ||
| podautoscaler | ||
| podgc | ||
| replicaset | ||
| replication | ||
| resourcequota | ||
| route | ||
| service | ||
| serviceaccount | ||
| statefulset | ||
| testutil | ||
| ttl | ||
| util/node | ||
| volume | ||
| .import-restrictions | ||
| BUILD | ||
| client_builder.go | ||
| controller_ref_manager.go | ||
| controller_ref_manager_test.go | ||
| controller_utils.go | ||
| controller_utils_test.go | ||
| doc.go | ||
| lookup_cache.go | ||
| OWNERS | ||