How-to Guides
Right-sizing Guide
How to review and apply Kubeadapt rightsizing recommendations to your workloads.
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:
| Profile | CPU Percentile | Memory Percentile | Approach |
|---|---|---|---|
| Production | P99 | P99 | Conservative: keeps generous headroom above peak usage |
| Non-production | P50 | P50 | Aggressive: 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
kubectlaccess to your cluster- A non-production environment for initial testing (recommended)
Step-by-Step Process
Step 1: Identify Candidates
- Go to Dashboard → Available Savings
- Filter by "Right-Sizing" category
- 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:
| Resource | Current | Recommended |
|---|---|---|
| CPU Request | 1000m | 400m |
| CPU Limit | 2000m | 800m |
| Memory Request | 2Gi | 768Mi |
| Memory Limit | 4Gi | 1536Mi |
Apply with kubectl patch:
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:
kubectl set resources deployment <name> -n <namespace> \
--requests=cpu=400m,memory=768Mi \
--limits=cpu=800m,memory=1536MiAfter applying, watch the rollout and check for pod restarts:
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:
- 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.
- Move to non-critical production workloads. Internal tools, batch jobs, low-traffic services, anything where a brief disruption has minimal business impact.
- Tackle critical production workloads. Apply recommendations one service at a time. Monitor each rollout before moving to the next.
- Finish up. Cover remaining workloads, tally total savings, and note anything you learned along the way.