Skip to main content

KA-B004: Missing memory limits

Warning Best Practice

Why This Matters

The container does not define a memory limit. Without memory limits, the container can consume unlimited memory on the node, potentially causing OOM kills of other pods. Setting memory limits equal to requests enables the Guaranteed QoS class for predictable scheduling.

How to Fix

Add a memory limit to the container resources

Before (incorrect)

containers:
  - name: app
    image: myapp:1.0
    resources:
      requests:
        memory: 128Mi

After (correct)

containers:
  - name: app
    image: myapp:1.0
    resources:
      requests:
        memory: 128Mi
      limits:
        memory: 256Mi

Rule Details

Rule Code
KA-B004
Severity
Warning
Category
Best Practice

Related Rules