Skip to content
This repository was archived by the owner on Apr 17, 2025. It is now read-only.

HierarchicalResourceQuota documentation #289

Merged
merged 1 commit into from
Jun 11, 2023

Conversation

zfrhv
Copy link
Contributor

@zfrhv zfrhv commented May 29, 2023

solves #264

i have a feeling my charges are not that great,
@adrianludwin what to you think of it for now?

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 29, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: zfrhv / name: Zahar (3aef487)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label May 29, 2023
@k8s-ci-robot k8s-ci-robot requested a review from adrianludwin May 29, 2023 19:06
@k8s-ci-robot
Copy link
Contributor

Welcome @zfrhv!

It looks like this is your first PR to kubernetes-sigs/hierarchical-namespaces 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/hierarchical-namespaces has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot requested a review from rjbez17 May 29, 2023 19:06
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 29, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @zfrhv. 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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 29, 2023
Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great! Thanks so much for writing this. I've made a bunch of minor copy-edits, can you please make those fixes and force-push them to the existing commit? Then we can get this in. Thanks again!

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jun 2, 2023
Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Can you please squash all your commits into one?

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 2, 2023

i knew i would have so mistakes and typos
but i didnt thought i would be so bad :I
sorry and thank you

@adrianludwin
Copy link
Contributor

i knew i would have so mistakes and typos but i didnt thought i would be so bad :I sorry and thank you

Not at all, I really appreciate all the work you put into this and all the work I didn't have to do as a result! My only other language is French and I guarantee you I can't write anything this good in French 😁

Copy link
Contributor

@adrianludwin adrianludwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just one last change and then I'll approve this. Thanks!

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 5, 2023

@adrianludwin
done!
but i didnt checked test\e2e\quickstart_test.go, i just added few tests from head
is there a pipeline that runs it? or do i need to install WSL and check it myself?

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 5, 2023

welp, i installed go (for some reason i thought its available only on linux), and idk how to run the test files
sorry i tried both go test quickstart_test.go and go run quickstart_test.go

@adrianludwin
Copy link
Contributor

You need to have a cluster with HNC installed, and your kubectl configured to point to it, before you try running the tests. Then you can say (see here):

HNC_FOCUS=Quickstart make test-e2e # Runs all tests in the "Quickstart" Describe block

If that doesn't work, no worries, lmk and I'll try running it for you.

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 5, 2023

sorry my clusters are airgapped, it will take me few days to test it

@adrianludwin
Copy link
Contributor

adrianludwin commented Jun 5, 2023

I just tried this out myself and found the following issues:

  • The yaml files cannot have any leading whitespace (see the other embedded yaml files)
    • The yaml files must be indented with two spaces, not tabs (not sure if you had tabs, or if my editor did that when I was fixing the formatting)
  • While you're limiting CPU and RAM, you're actually creating Services, which don't use any CPU or RAM - services are just load balancers to deployments. So you should try creating a Deployment instead - this is where you'll actually specify how much RAM and CPU you need.

I'd suggest creating the first Deployment in team-a and the second in team-b to demonstrate that they are sharing the same quota.

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 5, 2023
@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 5, 2023

The yaml files cannot have any leading whitespace (see the other embedded yaml files)
The yaml files must be indented with two spaces, not tabs (not sure if you had tabs, or if my editor did that when I was fixing the formatting)

yes sorry about that, i did copy pase of the yaml from quickstart.md and vscode just replaces my spaces with tabs

While you're limiting CPU and RAM, you're actually creating Services, which don't use any CPU or RAM - services are just load balancers to deployments. So you should try creating a Deployment instead - this is where you'll actually specify how much RAM and CPU you need.

yes, but the cpu and memory were just examples, the limitation was with amount of services.
i can create a deployment but i wanted to keep the example as simple as possible, and creating services is a lot easier than deployments.

i removed the cpu and memory from hrq now, you can check again
but if you think that demostrating with actual cpu/memory then i can make a deployment instead of service

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 5, 2023

oh no :0
i accidently squashed too many commits

@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 6, 2023

i simplified the quickstart a little,
let me know what you think and i will squash the commits

@adrianludwin
Copy link
Contributor

Ok, I tried it and it worked with the following changes. Nice work!

diff --git a/test/e2e/quickstart_test.go b/test/e2e/quickstart_test.go
index 72cf25d8..7f6f9565 100644
--- a/test/e2e/quickstart_test.go
+++ b/test/e2e/quickstart_test.go
@@ -217,13 +217,13 @@ spec:
                MustApplyYAML(hrq)
 
                // create service in team-a
-               MustRun("kubectl create service clusterip", nsTeamA + "-svc", `--clusterip="None"`, "-n", nsTeamA)
+               MustRun("kubectl create service clusterip", nsTeamA + "-svc", `--clusterip=None`, "-n", nsTeamA)
 
                // show that you can't use resources more than the hrq
-               MustNotRun("kubectl create service clusterip", nsTeamB + "-svc", `--clusterip="None"`, "-n", nsTeamB)
+               MustNotRun("kubectl create service clusterip", nsTeamB + "-svc", `--clusterip=None`, "-n", nsTeamB)
 
                // show hrq usage
-               RunShouldContain("services 1/1", defTimeout, "kubectl hns hrq", "-n", nsOrg)
+               RunShouldContain("services: 1/1", defTimeout, "kubectl hns hrq", "-n", nsOrg)
 
                MustRun("kubectl delete hrq", nsOrg + "-hrq", "-n", nsOrg)

Note the changes: no double-quotes around the "None" in --clusterip=None (the double-quotes are removed by bash when you type it by hand, but there's no shell in this test) and an added colon in services: 1/1.

Please go ahead and squash the commits. I'm going to have to enable HRQ by default before these tests will pass though so I'll work on that next.

@zfrhv zfrhv force-pushed the hrq-doc branch 2 times, most recently from 2914872 to ce7b5f8 Compare June 7, 2023 05:22
@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 7, 2023

done
should i create a new PR for #295 ? (so this doc wouldnt have to wait until that feature would be merge)

@adrianludwin
Copy link
Contributor

Actually - let's leave HRQ off in the default version of v1.1, I'll turn it on along with all the tests next.

Can you please disable this test by default (add a "P" before the It function so it says PIt - "P" for "Pending") and I'll enable it on the master branch next. Then I'll merge. Thanks!

@adrianludwin
Copy link
Contributor

Oh, and please add a mention that HRQ is off by default, and you need to use the hrq.yaml manifest to enable it? Thanks!

Signed-off-by: unknown <[email protected]>
@zfrhv
Copy link
Contributor Author

zfrhv commented Jun 7, 2023

sure thing!
i added it after the beta warning on each page, hope you like it
(and for some reason the new commit is not added to this PR, even tho i can clearly see it in my repo)

@zfrhv zfrhv force-pushed the hrq-doc branch 3 times, most recently from 689e3fe to 3aef487 Compare June 7, 2023 17:45
@rjbez17
Copy link
Contributor

rjbez17 commented Jun 11, 2023

/ok-to-test
/lgtm

@adrianludwin can approve when ready

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 11, 2023
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 11, 2023
@adrianludwin
Copy link
Contributor

Thank you for all these changes! Can you please cherry-pick this commit to v1.1 as well? Thanks! :)

/lgtm
/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: adrianludwin, zfrhv

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

The pull request process is described here

Needs approval from an approver in each of these files:

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 11, 2023
@k8s-ci-robot k8s-ci-robot merged commit b171aba into kubernetes-retired:master Jun 11, 2023
@zfrhv zfrhv mentioned this pull request Jun 11, 2023
k8s-ci-robot added a commit that referenced this pull request Jun 12, 2023
@adrianludwin adrianludwin added this to the release-v1.1 milestone Jun 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants