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

Commit 65a8ec6

Browse files
authored
Merge pull request #340 from mochizuki875/fix_doc_for_275
Add annotation about ResourceQuota for HRQ implementation to some documents
2 parents a68b2f8 + f74c77b commit 65a8ec6

File tree

3 files changed

+33
-23
lines changed

3 files changed

+33
-23
lines changed

docs/user-guide/concepts.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,13 +281,13 @@ the most restrictive quota always applies.
281281
This way, each namespace can fairly and securely distribute their resources across
282282
their subnamespaces.
283283

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.
284+
> _Note: To implement hierarchical quotas, HNC creates `ResourceQuota` objects named `hrq.hnc.x-k8s.io` 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._
289289
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)
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)_
291291
292292
<a name="basic-propagation">
293293

docs/user-guide/how-to.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ but across all the namespaces in a hierarchy. It allows you to distribute your r
200200
teams, and those teams can distribute their resources between their subteams.
201201
[Learn how it works](concepts.md#hierarchical-resource-quota) or see an [quickstart example](quickstart.md#hrq)
202202

203-
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)
203+
> _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)_
204204
205205
<a name="use-select"/>
206206

@@ -495,8 +495,8 @@ namespace will be silently ignored. This will eventually
495495
There is no need to uninstall HNC before upgrading it unless specified in the
496496
release notes for that version.
497497

498-
_Note: HNC has **experimental** support for HA deployments in v1.0+. Please
499-
contact us on Slack to discuss if you want to try it out._
498+
> _Note: HNC has **experimental** support for HA deployments in v1.0+. Please
499+
> contact us on Slack to discuss if you want to try it out._
500500
501501
#### Prerequisites
502502

docs/user-guide/quickstart.md

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,11 @@ By default, there's no relationship between these namespaces. For example, let's
5858
say that we want to make someone Site Reliability Engineer (SRE) for `team-a`,
5959
so we'll create an RBAC Role and a RoleBinding to that role.
6060

61-
Note: Typically, we'd create a rolebinding a user account, such as [email protected].
62-
However, every distribution of K8s has different authentication systems, and
63-
some (like [Kind](https://kind.sigs.k8s.io/)) don't have any at all.
64-
Therefore, this quickstart uses K8s service accounts instead of user accounts,
65-
but feel free to use any account that works on your cluster as you follow
66-
along.
61+
> _Note: Typically, we'd create a rolebinding a user account, such as [email protected].
62+
> However, every distribution of K8s has different authentication systems, and
63+
> some (like [Kind](https://kind.sigs.k8s.io/)) don't have any at all.
64+
> Therefore, this quickstart uses K8s service accounts instead of user accounts,
65+
> but feel free to use any account that works on your cluster as you follow along._
6766
6867
```bash
6968
kubectl -n team-a create role team-a-sre --verb=update --resource=deployments
@@ -210,9 +209,9 @@ simply use the config subcommand:
210209
kubectl hns config set-resource secrets --mode Propagate
211210
```
212211

213-
Note: The supported modes are `Propagate`, `Remove`, `Ignore` and (in HNC
214-
v1.1+ only) `AllowPropagate`. More may be added in the future; you can run
215-
`kubectl hns config set-resource` for the latest documentation.
212+
> _Note: The supported modes are `Propagate`, `Remove`, `Ignore` and (in HNC
213+
> v1.1+ only) `AllowPropagate`. More may be added in the future; you can run
214+
> `kubectl hns config set-resource` for the latest documentation._
216215
217216
Now, we should be able to verify that `my-creds` was propagated to `service-1`:
218217

@@ -280,9 +279,8 @@ installed on the cluster.
280279
281280
_Demonstrates: making Network Policies hierarchy-aware using the 'tree' label._
282281
283-
Note: this quickstart will only work if network policies are enabled on your
284-
cluster. Some flavours, such as KIND and GKE, do not enable network policies
285-
by default.
282+
> _Note: This quickstart will only work if network policies are enabled on your
283+
> cluster. Some flavours, such as KIND and GKE, do not enable network policies by default._
286284
287285
We now demonstrate propagation of Kubernetes network policies across a namespace
288286
hierarchy. Continuing from the [basic quickstart](#basic), let us add a second
@@ -482,7 +480,11 @@ all subnamespaces' resources can't surpass the HRQ.
482480
We will demonstrate how it works using services, but you could also limit `cpu`,
483481
`memory`, or any other `ResourceQuota` field.
484482

483+
> _Note: Decimal point values cannot be specified (you can't do `cpu: 1.5`, but
484+
> you can do `cpu: "1.5"` or `cpu: 1500m`). See [#292](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/292)_
485+
485486
Creating the HRQ:
487+
486488
```bash
487489
kubectl apply -f - << EOF
488490
apiVersion: hnc.x-k8s.io/v1alpha2
@@ -515,6 +517,7 @@ Error from server (Forbidden):
515517
```
516518

517519
You can view the HRQ usage by running `kubectl hns hrq` or `kubectl get hrq`:
520+
518521
```bash
519522
kubectl get hrq -n acme-org
520523
```
@@ -525,13 +528,20 @@ acme-org services: 1/1
525528
```
526529
You can also view HRQs in all namespaces by running `kubectl get hrq -A`.
527530

531+
> _Note: If you execute `kubectl get qouta` in namespace `acme-org`, `team-a` or `team-b`,
532+
> you will see `ResourceQuota` objects named `hrq.hnc.x-k8s.io`.
533+
> But it is part of the internal implementation of hierarchical resource quotas and shouldn't be modified or
534+
> inspected directly.
535+
> Also if you inspect the namespace information
536+
> using `kubectl describe ns <NAMESPACE NAME>`,
537+
> you may see Resource Quotas imformation of
538+
> `hrq.hnc.x-k8s.io`, which is also the case([#275](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/275))._
539+
528540
And finally, you can delete the HRQ by deleting the CR:
529541
```bash
530542
kubectl delete hrq acme-org-hrq -n acme-org
531543
```
532544

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

536546
<a name="subns"/>
537547

0 commit comments

Comments
 (0)