Tech Tip #33: Right-size your Kubernetes requests

Your pods reserve four times the CPU they use.

Video created by explainapaper.com

The problem

Resource requests are set once, generously, and never revisited. The scheduler reserves the capacity, so nodes fill up on paper while sitting mostly idle.

The fix you can use today

  • Compare requests with actual usage over a few weeks.
  • Set requests near the 95th percentile of real use.
  • Review after each release; usage changes with the code.

Tools that help

  • GreenCode Constitution skill (GreenCode researchers): open-source energy principles and a catalogue of 37 energy anti-patterns that an AI coding agent can follow to find and fix waste like this
  • Kepler: exports energy estimates per pod and container on Kubernetes, using eBPF and hardware counters

How GreenCode helps

GreenCode helps tackle this by mapping a running estate and rebuilding it as infrastructure as code. It attributes energy and CO2e to the services that cause it, including services that barely run. More on this.

Tags

#kubernetes#right-sizing#docker

Sources

All GreenCode Tech Tips

  • Tip #33
  • For Ops and infrastructure
  • Category Containers, Kubernetes and serverless
  • Format short video
GreenCode

Want this checked on your own system? Talk to the GreenCode team.

Get in touch