How to Use

Resource Recommendations in Agentkube IDE
Prerequisites
To use the Resource Recommender feature, ensure:- Prometheus is integrated with Agentkube IDE
- Prometheus is scraping cAdvisor metrics for container resource usage
- kube-state-metrics is deployed for Kubernetes object metadata
- Metric retention period covers at least 14 days for optimal recommendations
- Scrape interval is configured appropriately (typically 15-30 seconds)
- Navigate to the Workloads section
- Select Pods from the workload types
- Click on the Action button for the desired pod
- Select Telemetry from the dropdown menu
- Navigate to the Recommendation tab
- View CPU and memory recommendations based on historical data
Recommendation Strategy
Agentkube implements an intelligent recommendation strategy that balances resource efficiency with workload stability.CPU Recommendations
Request Calculation:- Based on the 95th percentile of historical CPU usage
- Allows pods to burst above the request when needed
- No CPU limit is set by default to permit bursting
container_cpu_usage_seconds_total
Memory Recommendations
Request/Limit Calculation:- Based on peak memory usage over the historical period
- Adds a 15% buffer to prevent OOM kills
- Sets both request and limit to the same value for predictability
container_memory_working_set_bytes
Data Requirements
The Resource Recommender requires 100+ historical datapoints to generate reliable recommendations. By default, it analyzes 14 days of historical data to capture regular usage patterns, peak load scenarios, and daily/weekly cycles.Metrics Used
The Resource Recommender leverages the following Prometheus metrics for analysis:Core Metrics
| Metric | Purpose | Description |
|---|---|---|
container_cpu_usage_seconds_total | CPU Usage | Total CPU time consumed by containers |
container_memory_working_set_bytes | Memory Usage | Current memory usage including cache but excluding reclaimable memory |
Supporting Metrics
| Metric | Purpose | Description |
|---|---|---|
kube_pod_container_resource_limits | Resource Limits | Configured resource limits for containers |
kube_pod_container_status_last_terminated_reason | OOM Detection | Identifies OOMKilled events for memory analysis |
kube_replicaset_owner | Pod Identification | Maps pods to their parent resources |
kube_pod_owner | Pod Identification | Identifies pod controllers |
kube_pod_status_phase | Pod Status | Current phase of pod lifecycle |
OOM Kill Detection
When Out-Of-Memory (OOM) kill events are detected, the Resource Recommender automatically adjusts recommendations:- Applies a 25% memory buffer (instead of 15%)
- Considers historical memory limits that were exceeded
- Helps prevent future OOM kills
kube_pod_container_resource_limitskube_pod_container_status_last_terminated_reason

