kubelet: Add image pulling event.

Since it takes a while (1-2mins) for kubelet to pulling a big image
(>500MB). Just showing "Pending" for pod status is not very helpful.

This commit introduces a "pulling" event, and inserts it before the
kubelet starts to pull an image.
This commit is contained in:
Yifan Gu
2015-06-08 17:41:10 -07:00
parent 213e7a8ab6
commit eb0fb43453
3 changed files with 25 additions and 11 deletions

View File

@@ -105,9 +105,12 @@ type RuntimeHooks interface {
// Determines whether the runtime should pull the specified container's image.
ShouldPullImage(pod *api.Pod, container *api.Container, imagePresent bool) bool
// Runs when we start to pull an image.
ReportImagePulling(pod *api.Pod, container *api.Container)
// Runs after an image is pulled reporting its status. Error may be nil
// for a successful pull.
ReportImagePull(pod *api.Pod, container *api.Container, err error)
ReportImagePulled(pod *api.Pod, container *api.Container, err error)
}
// Pod is a group of containers, with the status of the pod.