- As a DBaaS user, I need to see available resources and quotas on my Kubernetes cluster so that I can understand it's size
- user see the full capacity of the Cluster (cpu, memory) and it's every separate component
- User able to see free resources in the cluster
- Data for resources updated every 5s
Out of scope:
- This data will be based on requests not limits because they are always present in our clusters deployments, limits are not. Ability to choose between sourcing the data from limits and requests is out of the scope.
- Disk size is out of scope, I will include it in API so we can avoid additional API PRs in the future. But fields will return 0 values for disk sizes for now.
- To get all resources, go through every node that we can schedule on and sum their status->allocatable.
- To get available resoures, go through all pods in all namespaces, sum their requests and substract it from all resources.
- Add api to pmm /v1/management/DBaaS/Kubernetes/Resources/Get that returns
- Add Resources API to dbaas-api
- Connect these APIs in pmm-managed
How to test
- Latest FB: https://github.com/Percona-Lab/pmm-submodules/pull/1564#issuecomment-789941887
- UI tests failing seems to be false positive as it is not related to my changes.
- If not able to test with UI counter part
PMM-7486, please run this command:
- it should return response similar to this one:
- We don't include disk sizes because it is out of the scope of this ticket.
- all field is a sum of alocatable resources of Kubernetes cluster nodes that are scheduleable. For example we omit master node if it is tainted to forbid scheduling => taint node-role.kubernetes.io/master:NoSchedule
- available field is a sum of requests of every pod in the cluster. This does not take into account terminated init containers and pending pods. Also completed pods - failed or succeeded - are excluded.