Skip to main content
apiVersion: v1alpha1
kind: OOMConfig
triggerExpression: memory_full_avg10 > 12.0 && d_memory_full_avg10 > 0.0 && time_since_trigger > duration("500ms") # This expression defines when to trigger OOM action.
cgroupRankingExpression: 'memory_max.hasValue() ? 0.0 : ({Besteffort: 1.0, Burstable: 0.5, Guaranteed: 0.0, Podruntime: 0.0, System: 0.0}[class] * double(memory_current.orValue(0u)))' # This expression defines how to rank cgroups for OOM handler.
sampleInterval: 100ms # How often should the trigger expression be evaluated.
FieldTypeDescriptionValue(s)
triggerExpressionExpressionThis expression defines when to trigger OOM action.

The expression must evaluate to a boolean value.
If the expression returns true, then OOM ranking and killing will be handled.

This expression receives the following parameters:
- memory_{some,full}_{avg10,avg60,avg300,total} - double, representing PSI values
- time_since_trigger - duration since the last OOM handler trigger event
cgroupRankingExpressionExpressionThis expression defines how to rank cgroups for OOM handler.

The cgroup with the highest rank (score) will be evicted first.
The expression must evaluate to a double value.

This expression receives the following parameters:
- memory_max - Optionaluint - in bytes
- memory_current - Optionaluint - in bytes
- memory_peak - Optionaluint - in bytes
- path - string, path to the cgroup
- class - int. This represents cgroup QoS class, and matches one of the constants, which are also provided: Besteffort, Burstable, Guaranteed, Podruntime, System
sampleIntervalDurationHow often should the trigger expression be evaluated.

This interval determines how often should the OOM controller
check for the OOM condition using the provided expression.
Adjusting it can help tune the reactivity of the OOM handler.