Provide insight into resource usage
Before we allow user to install apps themselves, we want to have a way for them to see whether it will fit in terms of memory and/or cpu, mostly memory.
What we have already
- There are of course prometheus and Grafana (if the
monitoring
app is installed, that is). These provide detailed historical resource usage data, but there is a lot of data in there so you really have to know where to look. - We set kubernetes resource requests and limits. The limits can be overcommitted, but the requests not. If you install an app that would make the total request go over the available capacity, some of the app's pods will fail to be scheduled, resulting in a broken app and some prometheus alerts.
What we want
- A view in the dashboard of current resource usage. There are various choice to be made. Do we show static/formal memory usage (the kubernetes requests and/or limits)? Or actual historical resource usage? Or both?
- A view of projected resource usage of a new app to be installed.
- Tie that information into the app installation procedure. Again there are choices to be made. In particular, is the memory usage just informational, or do we prevent users from installing too much? If the latter, where do we place the threshold? Also even if we prevent app installation in some cases, we may want to disable that behaviour for some clusters where we trust the admin to make smart choices and/or live with the consequences.
- While we're at it, we probably want to include storage space as well in these views. Although it's not typically relevant for app installation, this is important information for the cluster admin and probably easy to add using the same or similar components as memory/cpu.
Related but out of scope for this issue
- Ideally, if the VPS size is not sufficient for installing a given app, there's an option to increase the VPS size right from the dashboard.
- Override memory limits for apps from the dashboard and/or show such overrides. We currently do this from
cli.stackspin.net
.