Resource Recommender
Resource Recommender is a Devtron feature that analyzes the historical resource usage (such as CPU and memory) of Kubernetes workloads in a specific cluster and generates data-backed recommendations for optimal resource allocation.
These recommendations are generated by a background job that runs daily at a particular time by default, using resource usage metrics collected from Prometheus. Job frequency can be customized by modifying the configuration in the ConfigMap. Refer Modify Resource Recommender Job Schedule to learn more.
It helps users eliminate manual guesswork, reduce over-provisioning, and prevent performance issues caused by under-provisioned workloads.
Who Can Perform This Action?
To view recommendations users need to have view permissions.
To apply recommendations users need to have access to the cluster.
Inspect Recommendations
To inspect the resource recommendations, follow the steps below:
Navigate to Resource Browser.
Figure 1: Navigating to Resource Browser Select the specific cluster for which you want to inspect the resource recommendations.
Figure 2: Selecting Cluster Select the Resource Recommender tab to inspect the recommendations.
Figure 3: Selecting Resource Recommender Each row displays workloads in that cluster, along with recommendations for CPU and memory.
Figure 4: Displaying Workloads along with Recommendations Recommendations are shown as percentage changes by default. You can toggle Show absolute values to see current v/s recommended values in actual units (e.g., 128Mi → 4900Ki).
Figure 5: Toggling 'Show Absolute Values'
You can inspect the resource recommendations for each workload within the cluster.
If you wish, you can filter the workloads based on their
Kind
andNamespace
.Figure 6a: Filtering via 'Kind' Figure 6b: Filtering via 'Namespace' You can also search for a specific workload via the search bar based on
kind
,Namespace
,API Version
, andWorkload
.Figure 7: Filtering via Search Bar
For each workload, recommendations can be of the following types:
Types of Recommendation
↑
Red upward arrow
Recommended value is higher than current
↓
Green downward arrow
Recommended value is lower than current
0% -
Gray dash (-)
Current value equals recommended
No Recommendation
No Recommendation
No recommendation available
Supported Resources
CPU REQUESTS
Minimum CPU allocated to the workload
CPU LIMITS
Maximum CPU allocatable to the workload
MEM REQUESTS
Minimum Memory (RAM) allocated to the workload
MEM LIMITS
Minimum Memory (RAM) allocatable to the workload
Hover the cursor over the specific resource of the particular workload to view the recommendation.
Figure 8a: Recommending for Increasing Resources Figure 8b: Recommending for Decreasing Resources Figure 8c: Recommending to not take any action Figure 8d: No Recommendation
Apply Recommendations
After inspecting the recommendations, you can directly apply them to your workloads. You can apply recommendations in the following ways
Apply Per Workload
To apply recommended resources to a specific workload, follow the steps below:
Select the specific workload and click Apply Changes, or hover over the specific workload row and click the Apply button that appears on hover.
Figure 9: Selecting Workload A modal window will open, displaying the comparison between the current and recommended resource values for that specific workload; review the recommended changes carefully.
Figure 10: Comparing Configurations Click Apply Changes to update the resource configuration.
Figure 11: Applying Changes
Bulk Apply
If you wish, you can apply recommended resource configurations to multiple or all workloads at once. To do so, follow the steps below:
Select the workloads for which you want to apply recommended resource configurations and click Apply Changes.
Figure 12: Selecting Workloads A modal window will open, displaying the comparison between the current and recommended resource values for each workload; review the recommended changes for each workload carefully.
Figure 13: Comparing Configurations for each workload Click Apply Changes to update the resource configuration.
Figure 14: Applying Changes
Export Recommendations in CSV File
You can also export resource recommendations to a CSV file. To do so, follow the steps below:
Filter the workloads for which you want to export resource recommendations, based on their
Kind
andNamespace
. By default, it will export resource recommendations for all workloads.Click the Download button; a dialog box appears asking you to choose the location where you want to save the file.
Figure 15a: Clicking Download Button Figure 15b: Export Ready Select the location where you want to save the file.
Click Save; the file will be saved at the selected location.
Figure 16: Clicking 'Save'
Modify Resource Recommender Job Schedule
To modify the schedule of the Resource Recommender background job, follow the steps below:
In a new tab, go to Resource Browser → (Select the Cluster for which you want to change modify resource recommender job schedule) → Config & Storage → ConfigMap
Select the Orchestrator/Devtron ConfigMap
If Devtron is managing your setup, contact Devtron support to perform these changes.
If you installed Devtron via Helm, select
devtron-cm
and click Edit Live Manifest.
Figure 17a: Selecting Devtron CM Figure 17b: Clicking 'Edit Live Manifest' Edit the
KRR_SYNC_JOB_CRON_SCHEDULE
key and set the schedule according to your use case using a cron expression.Click Apply Changes and manifest will be updated.
Figure 18: Applying Changes Restart the
orchestrator
ordevtron
pod to implement the changes.Figure 19: Restarting Pods