Most CPU and memory requests are set once, by a guess, and never looked at again. At Demuxer we build Kuberniq, a desktop Kubernetes client for macOS and Windows, and this article shows how it compares each container's requests with what it used over the last seven days.

The problem

A request reserves CPU and memory on a node whether the container uses it or not. To check one, you query Prometheus by hand, something like a percentile of the CPU rate and the peak of the memory working set per pod, write the numbers down, open the manifest, compare, and edit the YAML. Doing that for every workload in a cluster takes an afternoon, so it rarely gets done.

How Kuberniq does it

The recommendation of Kuberniq for feature-store: CPU request 490m to 360m and memory limit 4 GiB to 2.9 GiB, from 7 days of Prometheus

  1. In the Analysis tool window, choose Recommendations.
  2. Under Information, "The container requests more than it uses" lists the workloads. Select recommendations/feature-store.
  3. The detail says that the container requests more than it uses, with 390m of CPU left over across its 3 replicas, and a table of current and recommended values: CPU request 490m to 360m, memory request 2.6 GiB to 2.6 GiB, memory limit 4 GiB to 2.9 GiB. The table says where the numbers come from, "7 days of Prometheus at monitoring/prometheus", and how: CPU at the 95th percentile of the average per pod, memory at the peak per pod. That's the screenshot.
  4. Apply Recommendation… opens "Compare Deployment feature-store", with the 2 changes between In the cluster and After applying.
  5. Apply sends them, and Kuberniq confirms with "Recommendation applied to feature-store."

What it doesn't do yet

The recommendation covers the CPU request, the memory request and the memory limit. It doesn't set a CPU limit and doesn't change an autoscaler. It needs history to work from, and it changes the object in the cluster, not the manifest in your repository, so a Helm chart or a GitOps sync will put the old values back until you change them there too. There's also no Linux build; it runs on macOS and Windows.

Try it

The free license covers personal projects, study, teaching and open source, with the whole app and no account. If you size requests by hand today, we'd like to know whether the 95th percentile and the peak are the numbers you'd pick.

Download Kuberniq from its page: https://demuxer.dev/kuberniq?utm_source=devto&utm_medium=organic&utm_campaign=kuberniq-desktop&utm_content=dev-to%2Frightsizing