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

Commit 04d6342

Browse files
committed
docs: improve grammar and simplify HRQ examples
Was reading through the docs and these seemed the most verbose - it seems to be a very recent feature as well, from 3aef487 - use same heading in both Quickstart and Concepts, including HRQ abbreviation - use abbreviation to shorten the HRQ docs themselves as well - fix run-on sentences by adding punctuation - "by default, to use it" -> "by default. To use it" - add missing commas - "Then,", "finally,", etc - add Oxford commas - ", but", ", and", ", or", etc - simplify several sentences, per [k8s style guide](https://kubernetes.io/docs/contribute/style/style-guide/#use-simple-and-direct-language) - "won't be over the amount of resources that is configured in `HierarchicalResourceQuota`" -> "cannot surpass the HRQ" - "can't go over what is configured in the HRQ" -> "can't surpass the HRQ" - "And put the resources HRQ in" -> "An HRQ in" - "This will restrict whole" -> "restricts" (also uses present tense now, per style guide) - "the amount of resources that" -> "the resources" - "automatically creates" -> "creates" - in a similar vein, remove or replace ambiguous language - "equally shared" -> "shared" -- they can be shared however, not necessarily "equally" - "which is very efficient" -> "" -- "efficient" could be interpreted in a performance sense and is unnecesary - "lower level", "level" -> "child" / "sub" -- use HNC's existing terminology instead of "lower level", which has multiple disambiguations - Similarly use HNC's existing terminology for: - "individual", "members" -> "namespace", "subnamespaces" - "above", "overall" -> "parent" - "wins" -> "applies" -- replace idiom, per [style guide](https://kubernetes.io/docs/contribute/style/style-guide/#avoid-jargon-and-idioms) - clarify a few sentences with a single word - "within", "Instead", "still", "directly" - consolidate the two paragraphs on command-line usage into one - looks like they were added at different times, in 564b4a9 - they largely duplicated each other with slighlty different wording - creating an HRQ via a CR YAML is the definition of how CRs work, which are already used across HNC, so not necessary to re-explain - also remove the word "simply", per [style guide](https://kubernetes.io/docs/contribute/style/style-guide/#avoid-words-that-assume-a-specific-level-of-understanding) There are potentially more changes that could be made according to the style guide, but I primarily limited changes to simplifications, clarifications, and grammar
1 parent 8bbf903 commit 04d6342

File tree

2 files changed

+37
-36
lines changed

2 files changed

+37
-36
lines changed

docs/user-guide/concepts.md

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -227,18 +227,18 @@ You can create a subnamespace from the command line via `kubectl hns create chil
227227

228228
***Hierarchical resource quotas are beta in HNC v1.1***
229229

230-
***HRQs are not included by default, to use it install the hrq.yaml file in the [releases -> Assets](https://github.com/kubernetes-sigs/hierarchical-namespaces/releases)***
230+
***HRQs are not included by default. To use it, install the `hrq.yaml` file in [Releases -> Assets](https://github.com/kubernetes-sigs/hierarchical-namespaces/releases)***
231231

232232
When you want to give some amount of resources to `team-a`, and want them to be able to
233233
flexibly use resources in any of their subnamespaces, you create a `HierarchicalResourceQuota`
234-
in namespace `team-a`. The sum of all resources from all the subnamespaces of the
235-
members won't be over the amount of resources that is configured in
236-
`HierarchicalResourceQuota` of namespace `team-a`. All of the resources of `team-a` are
237-
equally shared between the applications in their subnamespaces, which is very efficient.
234+
in namespace `team-a`. The sum of all resources from all subnamespaces of `team-a`
235+
cannot surpass the HRQ in namespace `team-a`. All of the resources of `team-a` are
236+
shared between applications in their subnamespaces.
238237

239-
In addition, you can let an org or team's admin create their own hierarchical
240-
quotas without violating the overall HRQ for their org or team. For example,
238+
In addition, you can let an org or team's admin create sub-HRQs
239+
without violating the parent HRQ for their org or team. For example,
241240
if you start with the following structure:
241+
242242
```
243243
company-a
244244
├── organization-a
@@ -251,42 +251,43 @@ company-a
251251
│ ...
252252
...
253253
```
254-
Instead of each team asking from the `cluster-admin` to modify their `ResourceQuota`,
255-
you can insert an additional "policy" namespace above each level to hold
256-
the policy objects (like hierarchical quota) that the sub-admin _cannot_
257-
change, while giving them permission to create their own quotas in the
258-
lower level namespaces, like this:
254+
255+
Instead of each team asking a cluster admin to modify their `ResourceQuota`,
256+
you can insert an additional "policy" parent namespace to hold
257+
policy objects like HRQ. The sub-admin _cannot_ change the parent policies,
258+
but still has permission to create sub-HRQs in their subnamespaces, like this:
259+
259260
```
260261
company-a-policy
261262
└── company-a
262263
```
263-
And put the resources HRQ in the `company-a-policy` namespace. This will restrict
264-
whole `company-a` to the amount of resources that they are paying for. Then `company-a`
265-
can do similar HRQ with their organizations:
264+
265+
An HRQ in the `company-a-policy` namespace restricts
266+
`company-a` to the resources they are paying for. Then, `company-a`
267+
can create sub-HRQs for their internal organizations:
268+
266269
```
267270
company-a-policy (has HRQ)
268271
└── company-a
269-
├── org-a-policy (has HRQ)
272+
├── org-a-policy (has sub-HRQ)
270273
│ └── organization-a
271-
├── org-b-policy (has HRQ)
274+
├── org-b-policy (has sub-HRQ)
272275
│ └── organization-b
273276
...
274277
```
275-
Lower-level quotas cannot override more restrictive quotas from ancestor namespaces;
276-
the most restrictive quota always wins.
277-
This way each individual can fairly and securely distribute their resources across
278-
their members.
279-
280-
You can create the HRQ `CustomResource` by simply applying a yaml file, and see usage via `kubectl hns hrq` or `kubectl get hrq`. See
281-
[quickstart example](quickstart.md#hrq) for reference.
282278

279+
Child quotas cannot override more restrictive quotas from ancestor namespaces;
280+
the most restrictive quota always applies.
281+
This way, each namespace can fairly and securely distribute their resources across
282+
their subnamespaces.
283283

284-
To implement hierarchical quotas, HNC automatically creates `ResourceQuota` objects in each
285-
affected namespace. This is a part of the internal implementation and shouldn't be modified or
286-
inspected. Use the `kubectl hns hrq` command to inspect hierarchical quotas,
287-
or look at the `HierarchicalResourceQuota` object in the ancestor namespaces.
284+
To implement hierarchical quotas, HNC creates `ResourceQuota` objects in each
285+
affected namespace. This is part of the internal implementation and shouldn't be modified or
286+
inspected directly. Instead, use `kubectl hns hrq` to inspect hierarchical quotas
287+
or, in ancestor namespaces, `kubectl get hrq`.
288+
See the [quickstart example](quickstart.md#hrq) for reference.
288289

289-
Note: Decimal point values cannot be specified in HRQ (you can't do `cpu: 1.5` but you can do `cpu: "1.5"` or `cpu: 1500m`). See [#292](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/292)
290+
Note: Decimal point values cannot be specified in HRQ (you can't do `cpu: 1.5`, but you can do `cpu: "1.5"` or `cpu: 1500m`). See [#292](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/292)
290291

291292
<a name="basic-propagation">
292293

docs/user-guide/quickstart.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -461,11 +461,11 @@ kubectl delete pods s2 -n service-2
461461

462462
<a name="hrq"/>
463463

464-
### Hierarchical resource quotas
464+
### Hierarchical resource quotas (HRQs)
465465

466466
***Hierarchical resource quotas are beta in HNC v1.1***
467467

468-
***HRQs are not included by default, to use it install the hrq.yaml file in the [releases -> Assets](https://github.com/kubernetes-sigs/hierarchical-namespaces/releases)***
468+
***HRQs are not included by default. To use it, install the `hrq.yaml` file in [Releases -> Assets](https://github.com/kubernetes-sigs/hierarchical-namespaces/releases)***
469469

470470
_Will demonstrate: Create and delete [HierarchicalResourceQuota](concepts.md#hierarchical-resource-quota)._
471471

@@ -476,11 +476,11 @@ acme-org
476476
└── [s] team-b
477477
```
478478

479-
You can create a `HierarchicalResourceQuota` in namespace `acme-org`, and the sum of
480-
all subnamespaces resource usage can't go over what is configured in the HRQ.
479+
If you create a `HierarchicalResourceQuota` in namespace `acme-org`, the sum of
480+
all subnamespaces' resources can't surpass the HRQ.
481481

482482
We will demonstrate how it works using services, but you could also limit `cpu`,
483-
`memory` or any other `ResourceQuota` field.
483+
`memory`, or any other `ResourceQuota` field.
484484

485485
Creating the HRQ:
486486
```bash
@@ -525,12 +525,12 @@ acme-org services: 1/1
525525
```
526526
You can also view HRQs in all namespaces by running `kubectl get hrq -A`.
527527

528-
And finally you can delete the HRQ via simply deleting the CR:
528+
And finally, you can delete the HRQ via simply deleting the CR:
529529
```bash
530530
kubectl delete hrq acme-org-hrq -n acme-org
531531
```
532532

533-
Note: Decimal point values cannot be specified (you can't do `cpu: 1.5` but
533+
Note: Decimal point values cannot be specified (you can't do `cpu: 1.5`, but
534534
you can do `cpu: "1.5"` or `cpu: 1500m`). See [#292](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/292)
535535

536536
<a name="subns"/>

0 commit comments

Comments
 (0)