Merge pull request #2267 from erictune/kubelet_events

Kubelet event on restart.
This commit is contained in:
Daniel Smith 2014-11-10 15:00:56 -08:00
commit b6f68988ed
2 changed files with 16 additions and 0 deletions

View File

@ -188,6 +188,9 @@ func main() {
*registryBurst,
*minimumGCAge,
*maxContainerCount)
k.BirthCry()
go func() {
util.Forever(func() {
err := k.GarbageCollectContainers()

View File

@ -998,3 +998,16 @@ func (kl *Kubelet) RunInContainer(podFullName, uuid, container string, cmd []str
}
return kl.runner.RunInContainer(dockerContainer.ID, cmd)
}
// BirthCry sends an event that the kubelet has started up.
func (kl *Kubelet) BirthCry() {
// Make an event that kubelet restarted.
// TODO: get the real minion object of ourself,
// and use the real minion name and UID.
ref := &api.ObjectReference{
Kind: "Minion",
Name: kl.hostname,
UID: kl.hostname,
}
record.Eventf(ref, "", "starting", "Starting kubelet.")
}