kubernetes-sigs / hierarchical-namespaces

Home of the Hierarchical Namespace Controller (HNC). Adds hierarchical policies and delegated creation to Kubernetes namespaces for improved in-cluster multitenancy.
Apache License 2.0
619 stars 105 forks source link

change resource quota name #275 #301

Closed keisukesakasai closed 1 year ago

keisukesakasai commented 1 year ago

What this PR does it:

I have renamed the name of the Resource Quotas created from HRQ. Originally, the name of the ResourceQuotas was hrq.hnc.x-k8s.io, but it has been changed to local-impl.hnc.x-k8s.io as part of this update. Please refer to this link: https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/275#issuecomment-1564981395.

Operation confirmation:

I have confirmed that the name of the Resource Quota created from HRQ is local-impl-hrq.hnc.x-k8s.io.

The confirmation steps are as follows.

ns relationship:

❯ k hns tree parent
parent
└── [s] child

create HRQ:

❯ kubectl apply -f - << EOF
apiVersion: hnc.x-k8s.io/v1alpha2
kind: HierarchicalResourceQuota
metadata:
  name: parent-hrq
  namespace: parent
spec:
  hard:
    limits.memory: 500Mi
    requests.memory: 500Mi
    limits.cpu: "2"
    requests.cpu: "2"
EOF
hierarchicalresourcequota.hnc.x-k8s.io/parent-hrq created

❯ k get hrq -nparent
NAME         REQUEST                                       LIMIT
parent-hrq   requests.cpu: 0/2, requests.memory: 0/500Mi   limits.cpu: 0/2, limits.memory: 0/500Mi

Check the names of the ResourceQuotas created from HRQ:

❯ k get resourcequotas -nparent
NAME                          AGE   REQUEST                                       LIMIT
local-impl-hrq.hnc.x-k8s.io   54s   requests.cpu: 0/2, requests.memory: 0/500Mi   limits.cpu: 0/2, limits.memory: 0/500Mi

❯ k get resourcequotas -nchild
NAME                          AGE    REQUEST                                       LIMIT
local-impl-hrq.hnc.x-k8s.io   115s   requests.cpu: 0/2, requests.memory: 0/500Mi   limits.cpu: 0/2, limits.memory: 0/500Mi

Tested:

Unit and E2E tests has passed.

Which issue(s) this PR fixes:

https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/275

linux-foundation-easycla[bot] commented 1 year ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 1 year ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: keisukesakasai Once this PR has been reviewed and has the lgtm label, please assign srampal for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
k8s-ci-robot commented 1 year ago

Hi @keisukesakasai. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
mochizuki875 commented 1 year ago

/ok-to-test

mochizuki875 commented 1 year ago

/lgtm /assign @adrianludwin

keisukesakasai commented 1 year ago

@adrianludwin please take a look? thx!

adrianludwin commented 1 year ago

I'm out this week, will look when I'm back next week, sorry!

On Wed, Jun 28, 2023, 9:16 p.m. Keisuke SAKASAI @.***> wrote:

@adrianludwin https://github.com/adrianludwin please take a look? thx!

— Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/hierarchical-namespaces/pull/301#issuecomment-1612297865, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE43PZFXU6OSRA7BDEG45HLXNTJNJANCNFSM6AAAAAAZLUTUCU . You are receiving this because you were mentioned.Message ID: @.***>

adrianludwin commented 1 year ago

Sorry for disappearing again...

I'm having second thoughts about this - firstly (and most importantly), this doesn't clean up any existing hrq resource quotas, so this will leave a bunch of stranded RQs around. We could fix that, but I'm not sure it's worth the trouble? Especially now that #283 has been merged.

If anything, perhaps we could add some kind of annotation with a human-readable message basically saying "don't read this."

mochizuki875 commented 1 year ago

@adrianludwin

this doesn't clean up any existing hrq resource quotas, so this will leave a bunch of stranded RQs around.

As you said, compatibility is important and this may cause breaking changes. So I agree with your idea.(leaving it alone)

And I think we should add some annotations to HRQ document. For example, add here with clarifying the RQ name hrq.hnc.x-k8s.io:

https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/74fe01460083fd410a8fbd728eb255c4d728dbcb/docs/user-guide/concepts.md?plain=1#L284-L286

https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/74fe01460083fd410a8fbd728eb255c4d728dbcb/docs/user-guide/quickstart.md?plain=1#L517

@keisukesakasai What do you think?

adrianludwin commented 1 year ago

Hey @mochizuki875 that sounds like a good idea, thanks!

rjbez17 commented 1 year ago

@mochizuki875 are we abandoning this?

mochizuki875 commented 1 year ago

@rjbez17 Yes, so we should close this PR. /close

k8s-ci-robot commented 1 year ago

@mochizuki875: Closed this PR.

In response to [this](https://github.com/kubernetes-sigs/hierarchical-namespaces/pull/301#issuecomment-1782361981): >@rjbez17 >Yes, so we should close this PR. >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.