Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add resource quotas widget #489

Closed
callmevladik opened this issue Nov 19, 2024 · 0 comments · Fixed by #490
Closed

Add resource quotas widget #489

callmevladik opened this issue Nov 19, 2024 · 0 comments · Fixed by #490
Assignees
Labels
feature New functionality

Comments

@callmevladik
Copy link
Contributor

callmevladik commented Nov 19, 2024

Technical considerations:

check resource with kind: ResourceQuota with label: capsule.clastix.io/tenant: ;
check rbac permissions to get ResourceQuota objects;
if ResourceQuota available with correct label and permission enough to get resources - display widget;
in two ResourceQuota expected:
apiVersion: v1
kind: ResourceQuota
metadata:
name: capsule-eks-vp-release-1
namespace: eks-vp-release
labels:
capsule.clastix.io/resource-quota: '1'
capsule.clastix.io/tenant: eks-vp-release
annotations:
quota.capsule.clastix.io/hard-pods: '100'
quota.capsule.clastix.io/used-pods: '9'

apiVersion: v1
kind: ResourceQuota
metadata:
name: capsule-eks-vp-release-0
namespace: eks-vp-release
labels:
capsule.clastix.io/resource-quota: '0'
capsule.clastix.io/tenant: eks-vp-release
annotations:
quota.capsule.clastix.io/hard-limits.cpu: '7'
quota.capsule.clastix.io/hard-limits.memory: 6Gi
quota.capsule.clastix.io/hard-requests.cpu: '3'
quota.capsule.clastix.io/hard-requests.memory: 3Gi
quota.capsule.clastix.io/used-limits.cpu: 2256m
quota.capsule.clastix.io/used-limits.memory: 2934Mi
quota.capsule.clastix.io/used-requests.cpu: 446m
quota.capsule.clastix.io/used-requests.memory: 984Mi

Get Capacity for resources from: metadata.annotations.quota.capsule.clastix.io/hard-pods and current usage: metadata.annotations.quota.capsule.clastix.io/used-pods;
Get Capacity for resources from: metadata.annotations.quota.capsule.clastix.io/hard-limits.cpu, metadata.annotations.quota.capsule.clastix.io/hard-limits.memory, metadata.annotations.quota.capsule.clastix.io/hard-requests.cpu, metadata.annotations.quota.capsule.clastix.io/hard-requests.memory and current usage: metadata.annotations.quota.capsule.clastix.io/used-limits.cpu, metadata.annotations.quota.capsule.clastix.io/used-limits.memory, metadata.annotations.quota.capsule.clastix.io/used-requests.cpu, metadata.annotations.quota.capsule.clastix.io/used-requests.memory
These fields may be absent or expanded;
The widget needs to display the consumption of each resource in real time;
if at least one of the parameters has reached the 90% mark - change the widget color;
The same approach we need to enable for resources that we deploy using platform;
get environment namespace from kind: Stage spec.namespace
check resource with kind: ResourceQuota with label: capsule.clastix.io/tenant: ;
check rbac permissions to get ResourceQuota objects;
if ResourceQuota available with correct label and permission enough to get resources - display widget;
use the same field and the same approach to display resources widget for environment like for platfom;
Make sure that we cover case whe we do not use capsule and ResourceQuota does not exist;

@callmevladik callmevladik converted this from a draft issue Nov 19, 2024
@callmevladik callmevladik self-assigned this Nov 19, 2024
@callmevladik callmevladik added the feature New functionality label Nov 19, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in KubeRocketCI Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New functionality
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

1 participant