diff --git a/deployment/node-problem-detector-config.yaml b/deployment/node-problem-detector-config.yaml index ad70f4a7d..907905c92 100644 --- a/deployment/node-problem-detector-config.yaml +++ b/deployment/node-problem-detector-config.yaml @@ -25,6 +25,11 @@ data: "reason": "OOMKilling", "pattern": "Kill process \\d+ (.+) score \\d+ or sacrifice child\\nKilled process \\d+ (.+) total-vm:\\d+kB, anon-rss:\\d+kB, file-rss:\\d+kB.*" }, + { + "type": "temporary", + "reason": "PodOOMKilling", + "pattern": "Task in /kubepods/\\S+ killed as a result of limit of /kubepods/\\S+" + }, { "type": "temporary", "reason": "TaskHung", diff --git a/pkg/systemlogmonitor/log_monitor.go b/pkg/systemlogmonitor/log_monitor.go index b182585ec..373f708d6 100644 --- a/pkg/systemlogmonitor/log_monitor.go +++ b/pkg/systemlogmonitor/log_monitor.go @@ -18,6 +18,7 @@ package systemlogmonitor import ( "encoding/json" + "fmt" "io/ioutil" clientset "k8s.io/client-go/kubernetes" "k8s.io/heapster/common/kubernetes" @@ -26,9 +27,6 @@ import ( "os" "path/filepath" "regexp" - "strings" - - "fmt" "time" "github.com/golang/glog" @@ -65,7 +63,7 @@ func init() { } func init() { - uuidRegx = regexp.MustCompile("[0-9a-f]{8}_[0-9a-f]{4}_[0-9a-f]{4}_[0-9a-f]{4}_[0-9a-f]{12}") + uuidRegx = regexp.MustCompile("[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}") } type logMonitor struct { @@ -205,7 +203,6 @@ func (l *logMonitor) generateStatus(logs []*logtypes.Log, rule systemlogtypes.Ru if rule.Reason == OOMREASON && k8sClient != nil { uuid := string(uuidRegx.Find([]byte(message))) - uuid = strings.ReplaceAll(uuid, "_", "-") pl, err := k8sClient.CoreV1().Pods("").List(metav1.ListOptions{}) if err != nil { glog.Error("Error in getting pods: %v", err.Error())