Skip to content
New issue

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

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

Already on GitHub? # to your account

ns describe quota used not update #275

Closed
j0rGeT opened this issue Apr 21, 2023 · 11 comments
Closed

ns describe quota used not update #275

j0rGeT opened this issue Apr 21, 2023 · 11 comments
Assignees

Comments

@j0rGeT
Copy link

j0rGeT commented Apr 21, 2023

I found that when the hrq quota is used, the quota information used in describe ns is not updated. After the quota used in the child ns is updated, the value of used in the parent ns is still 0。

parent-ns:

root@saar-virtual-machine:~# kubectl describe ns kubecube-workspace-workspacez5
Name:         kubecube-workspace-workspacez5

Resource Quotas
 Name:                    hrq.hnc.x-k8s.io
 Resource                 Used  Hard
 --------                 ---   ---
 limits.cpu               0     2
 limits.memory            0     500Mi
 requests.cpu             0     2
 requests.memory          0     500Mi
 requests.nvidia.com/gpu  0     0`

sub-ns:

root@saar-virtual-machine:~# kubectl describe ns kubecube-project-projectz1
Name:         kubecube-project-projectz1
Status:       Active

Resource Quotas
 Name:                    hrq.hnc.x-k8s.io
 Resource                 Used  Hard
 --------                 ---   ---
 limits.cpu               1     2
 limits.memory            100M  500Mi
 requests.cpu             1     2
 requests.memory          100M  500Mi
 requests.nvidia.com/gpu  0     0
@zfrhv
Copy link
Contributor

zfrhv commented May 17, 2023

true, also mentioned in #274
when describing the ns it displays the ResourceQuota and not the HierarchicalResourceQuota
so the values in the ResourceQuota are not updated

@mochizuki875
Copy link
Member

HierarchicalResourceQuota seems to be implemented by the combination of ResourceQuota and Admission Webhook.
ResourceQuota is namespaced resource and just control the namespace's resource consumption.
So if child ns is updated, it is not reflected in parent ns.
It is reflected to HierarchicalResourceQuota's status field.

@adrianludwin
Copy link
Contributor

Yeah, hrq.hnc.x-k8s.io is just the per-namespace implementation of the HRQ - it has no visibility into what's happening in the rest of the hierarchy. But @mochizuki875 's amazing PR (#283) will at least make it easy to understand what's there.

Perhaps we should give that RQ a more descriptive name - e.g. local-impl.hnc.x-k8s.io would more clearly emphasize that you shouldn't trust the data in here. wdyt?

(Sorry for the delays, just some maintainer burnout)

@zfrhv
Copy link
Contributor

zfrhv commented May 26, 2023

@adrianludwin
thats a very good idea

@keisukesakasai
Copy link

@adrianludwin
Hi, I will try to fix this. Is "local-impl." OK?

/assign @keisukesakasai

@adrianludwin
Copy link
Contributor

adrianludwin commented May 29, 2023

Maybe it's nice to get the word "hrq" in there as well - e.g. if local-impl-hrq lgty, then I'm good with it too. Thanks!

@zfrhv
Copy link
Contributor

zfrhv commented May 29, 2023

@adrianludwin
@keisukesakasai
maybe its better to include the original namespace name in which hrq is created, or the hrq resource name?
for example: <namespace name>-hrq-local-imp
just in case there are multiple hrqs in the namespace tree.

for example in this case:

grandpa (has hrq)
├─ father1 (has hrq)
│  ├─ son1
│  ├─ son2
├─ father2

there should be 2 ResourceQuotas in namespace son1, and they cant have the same name
(if i correctly understand how it works)

@adrianludwin
Copy link
Contributor

HNC combines the limits from grandpa and father1 already, so we can't name it after the "real" object's namespace because there could be multiple of them.

@mochizuki875
Copy link
Member

For this issue, we should add some kind annotation to document as discussed #301 (comment).

@mochizuki875
Copy link
Member

Close this issue as #340 has been merged.
/close

@k8s-ci-robot
Copy link
Contributor

@mochizuki875: Closing this issue.

In response to this:

Close this issue as #340 has been merged.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants