rancher
rancher copied to clipboard
Add chart annotations to help UI show CPU & memory requirements vs. actual remaining requirements when project monitoring installed
When a user installs project monitoring, show a banner that compares the required CPU and memory with actual remaining CPU and memory in the project resource quota.
The UI will show warnings about CPU and memory if these annotations are added to the Prometheus Federator Helm chart:
catalog.cattle.io/requests-cpu
catalog.cattle.io/requests-memory
@gaktive ~~I think we should transfer this to the backend because after taking a look at how the existing CPU/memory warnings work, there shouldn't be any UI changes needed if these annotations are added to the chart.~~
Edit: UI changes will be needed and there are unanswered design questions - see below comment.
For context, this feature already exists for the monitoring chart. The result is a warning banner that shows in the UI:
After discussion with Geet and Arvind, I realized my above comment is wrong - this won't work exactly the same as it will for monitoring. There are two differences:
- While the UI code for determining the warnings for monitoring is on the chart install page, the UI code for determining the warnings for project monitoring will need to be on the create/edit form for a
ProjectHelmChart
resource. - While the UI takes the monitoring annotations from the Helm chart data itself, the annotations for project monitoring resource requirements would come from a different source (something other than the Prometheus Federator chart itself). It sounds like the exact source is TBD.
To determine available resource capacity, the Rancher UI will probably have to check the remaining resources of the cluster as a whole because the system project is not expected to have a project resource quota.
There is an unanswered question of exactly how the Rancher UI will calculate how much CPU/memory is available. Will it subtract all the reserved CPU/memory from the total CPU/memory in the cluster to get the remainder, or will it only subtract the amount of CPU/memory that was actually used? If the latter is true, the UI could allow too many project monitors to get deployed.
We should take into account the fact that the user deploying the ProjectHelmChart resource may only have permission to see CPU/memory usage in their own project.
Note for whomever takes this. This can be tackled along with whatever rewrite we do regarding resource quotas and monitoring.