Recently I research about how kubernetes deal with the System OOM events. But I have a question about how kubelet report OOM events to API Server.
I find OOM code in /kubernetes/pkg/kubelet/oom_watcher.go
for event := range eventChannel.GetChannel() {
glog.V(2).Infof("Got sys oom event from cadvisor: %v", event)
ow.recorder.PastEventf(ref, metav1.Time{Time: event.Timestamp}, v1.EventTypeWarning, systemOOMEvent, "System OOM encountered")
}
And I know kubelet write the OOM events to the recorder whitch kubelet init. But how kubelet or apiserver consume the recorder events?
Where the code I can find kubelet consume the events or report it to apiserver?