Skip to content

How-to Guides

Right-sizing Guide

How to review and apply Kubeadapt rightsizing recommendations to your workloads.

Last updated


Kubeadapt takes a request-centric approach to right-sizing: recommendations target resource requests (the primary cost driver), computed from actual usage percentiles with dynamic buffers for growth trends and usage variability. The values you apply already include built-in headroom.

Two default analysis profiles control how aggressive the recommendations are:

ProfileCPU PercentileMemory PercentileApproach
ProductionP99P99Conservative: keeps generous headroom above peak usage
Non-productionP50P50Aggressive: optimizes for cost, safe for non-production

For the full breakdown of how recommendations are computed (buffer formulas, limit strategies, environment-specific policies), see Right-sizing Concepts.


Prerequisites

  • Resource requests and limits defined on your workloads
  • kubectl access to your cluster
  • A non-production environment for initial testing (recommended)

Step-by-Step Process

Step 1: Identify Candidates

  1. Go to Dashboard → Available Savings
  2. Filter by "Right-Sizing" category
  3. Sort by "Savings" to prioritize high-impact workloads

Step 2: Review the Recommendation

Click a workload to open the details view. Check the resource usage charts for:

  • P99 Usage to understand spike patterns
  • Volatility to gauge usage stability
  • Incidents like OOM kills or CPU throttling

Then review the recommended values.


Step 3: Test in a Non-Production Environment

Apply the recommended values to a non-production deployment first. Monitor the workload in the Kubeadapt dashboard before touching production.


Step 4: Apply to Production

Copy the recommended values from the workload details page:

ResourceCurrentRecommended
CPU Request1000m400m
CPU Limit2000m800m
Memory Request2Gi768Mi
Memory Limit4Gi1536Mi

Apply with kubectl patch:

bash
1kubectl patch deployment <name> -n <namespace> --type='json' -p='[
2  {"op": "replace", "path": "/spec/template/spec/containers/0/resources/requests/cpu", "value": "400m"},
3  {"op": "replace", "path": "/spec/template/spec/containers/0/resources/requests/memory", "value": "768Mi"},
4  {"op": "replace", "path": "/spec/template/spec/containers/0/resources/limits/cpu", "value": "800m"},
5  {"op": "replace", "path": "/spec/template/spec/containers/0/resources/limits/memory", "value": "1536Mi"}
6]'

Or use kubectl set resources for a shorter command:

bash
kubectl set resources deployment <name> -n <namespace> \
  --requests=cpu=400m,memory=768Mi \
  --limits=cpu=800m,memory=1536Mi

After applying, watch the rollout and check for pod restarts:

bash
kubectl rollout status deployment/<name> -n <namespace>

Step 5: Confirm Savings

Check the Kubeadapt dashboard over the following days to confirm the cost reduction matches what was projected.


Gradual Rollout

Don't try to optimize every workload at once. Spread the work over a few weeks:

  1. Start with non-production. Pick a handful of non-critical workloads in a non-production cluster. Apply recommendations, watch for a week, get comfortable with the process.
  2. Move to non-critical production workloads. Internal tools, batch jobs, low-traffic services, anything where a brief disruption has minimal business impact.
  3. Tackle critical production workloads. Apply recommendations one service at a time. Monitor each rollout before moving to the next.
  4. Finish up. Cover remaining workloads, tally total savings, and note anything you learned along the way.