Skip to content

Commit

Permalink
Merge pull request #31 from uswitch/oomkill
Browse files Browse the repository at this point in the history
Migrated from fork: Differentiate between OOMKill and exceeding termination grace period
  • Loading branch information
MatteoMori8 authored Jul 9, 2024
2 parents 02e222d + 80087cb commit 53a174e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rules/unsuccessful_exit.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@ var UnsuccessfulExitRule = engine.NewRule(
case 143: // JVM SIGTERM
break
case 137: // Process got SIGKILLd
ctx.Alertf(newObj, "Pod `%s.%s` (container: `%s`) was killed by a SIGKILL. Please make sure you gracefully shut down in time or extend `terminationGracePeriodSeconds` on your pod.", pod.ObjectMeta.Namespace, pod.ObjectMeta.Name, c.Name)
if c.State.Terminated.Reason == "OOMKilled" {
ctx.Alertf(newObj, "Pod `%s.%s` (container: `%s`) ran out of memory and was killed.", pod.ObjectMeta.Namespace, pod.ObjectMeta.Name, c.Name)
} else {
ctx.Alertf(newObj, "Pod `%s.%s` (container: `%s`) was killed by a SIGKILL. Please make sure you gracefully shut down in time or extend `terminationGracePeriodSeconds` on your pod.", pod.ObjectMeta.Namespace, pod.ObjectMeta.Name, c.Name)
}
default:
tailLines := int64(20)
opts := &v1.PodLogOptions{
Expand Down

0 comments on commit 53a174e

Please sign in to comment.