Sobes.tech
Junior — Middle

What technology does Kubernetes use for resource limiting of containers?

sobes.tech AI

Answer from AI

Kubernetes uses the cgroups (control groups) mechanism of the Linux kernel to limit container resources.

With cgroups, you can set limits on:

  • CPU (for example, the number of available cores or the share of processor time)
  • Memory (the maximum amount of RAM used)
  • Other resources (such as I/O)

In Kubernetes, this is implemented through resource specifications in Pod or container manifests:

resources:
  limits:
    memory: "512Mi"
    cpu: "1"
  requests:
    memory: "256Mi"
    cpu: "0.5"

Where requests are guaranteed resources, and limits are the maximum allowable.

Thus, Kubernetes manages container resources using cgroups capabilities for isolation and control.