Find the Best Cosmetic Hospitals

Compare hospitals & treatments by city — choose with confidence.

Explore Now

Ten Steps to Rightsize a KubernetesOps Cluster With Real Numbers

Ten Steps to Rightsize a KubernetesOps Cluster With Real Numbers
Tech Careers

Bengaluru’s tech teams know the feeling of booking a bigger room than the meeting needs. Servers drift into the same habit: capacity gets reserved for the worst day imagined, and then sits idle for the other three hundred and sixty-four. In KubernetesOps this shows up as the gap between what workloads ask for and what they actually consume. The steps below show a precise, repeatable way to close that gap, using a worked example from the Ops Atlas so that every number can be checked.

Step 1: Understand why requests drive everything

A Kubernetes scheduler decides where a workload goes by reading its declared CPU and memory requests, not its real usage. The cluster autoscalers use those same declarations when deciding to add or remove machines. This is why the Atlas’s KubernetesOps write-up calls requests a contract: whatever you promise on paper is what the cluster reserves, whether or not the pods ever touch it. Inflated promises mean paid-for machines doing nothing.

Step 2: Work out what a node can really offer

Not every core on a machine is available to your pods, because the system itself needs a share. In the Atlas’s example, a node with 16 CPUs keeps 14.5 allocatable. Ten such nodes therefore give 145 allocatable CPUs. Use your own cluster’s allocatable figure rather than the sticker size of the machine; the difference is where early capacity surprises begin.

Step 3: Measure allocation

Add up the CPU requests across all workloads. The example cluster has 120 requested against 145 allocatable, an allocation of 82.8 percent. On paper the cluster looks nearly full, and anyone reading only that number would reach for more machines.

Step 4: Measure real usage

Now compare with observed consumption. Take a high percentile of usage over a representative period; the Atlas uses the 95th percentile, which came to 42 CPUs. Dividing usage by requests gives 35 percent. Put plainly, the pods use about a third of what they reserved. Two numbers, 82.8 percent allocated and 35 percent used, tell completely different stories, and the difference is your savings opportunity.

Step 5: Choose a safe margin

Resist trimming requests down to the bare average. The Atlas’s recommendation in this example is to set requests at roughly the 95th percentile plus thirty percent headroom, which comes to about 55 CPUs. Headroom protects you from the spiky days when traffic climbs. You can gather recommended values without risk by running the Vertical Pod Autoscaler in its Off mode, where it only suggests numbers and changes nothing.

Step 6: Recompute the node count

With about 55 CPUs of requests and a target allocation of 75 percent, the example cluster fits on six nodes rather than ten. Run the same sum for memory, because the tighter of the two resources decides the size. Then compare the proposal to your reliability needs, such as spreading replicas across failure zones, before you remove anything.

Step 7: Roll the change out gradually

Apply the new requests to a small set of non-critical workloads first. Newer Kubernetes releases allow resizing a running pod without restarting it; the Atlas notes this reached stable status in version 1.35, with two catches: the pod keeps its original service tier, and giving memory back is done on a try-your-luck basis. Watch for pods being killed or throttled, then widen the rollout over several days.

Step 8: Mind the autoscaling order

If you use the Horizontal Pod Autoscaler on CPU, remember that it needs CPU requests to calculate utilisation at all. Its rule is simple enough to do on paper: take today’s replica count and scale it by how far the observed figure sits above the goal, then round up. Take four replicas observed at 90 percent where the goal is 60, and the answer is six. A tolerance of 0.1 means small wobbles, such as 64 percent against 60, cause no change. The Atlas also cites the Vertical Pod Autoscaler project’s own advice not to combine both autoscalers on the same CPU or memory metric.

Step 9: Confirm machines actually leave

Savings only appear when nodes are removed. The Cluster Autoscaler, by default, considers a node for removal only when it is below fifty percent requested, so a cluster sitting at 70 percent on every node will never shrink on its own. Review that threshold deliberately and re-run steps three and four after a week.

Step 10: Make it a monthly habit

Record allocation, the usage-to-request ratio and unschedulable pods in a small table each month. Trends matter more than snapshots. A ratio creeping from 35 percent upward signals that rightsizing is working, while pods stuck unschedulable warn you that you cut too deep.

Slip-ups to avoid along the way

Three mistakes recur when teams run this procedure for the first time. They measure usage over a quiet week and miss the monthly peak, so the margin turns out too thin. They shrink requests but forget the memory side of the sum, which then becomes the binding limit. And they celebrate a lower node count without checking that replicas are still spread across zones. A short review meeting after each pass, with the three tables from steps three, four and six on screen, catches all of these before they reach users.

After a long evening of spreadsheets, step away from the screen. Visitors and residents alike can browse a rundown of stage and theatre options around the city or look through the kinds of live music nights that visitors can catch. Rightsized clusters leave time for such things, which is perhaps the strongest argument for doing the sums properly.

Best Cardiac Hospitals

Find heart care options near you.

View Now