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

Commit 2925068

Browse files
authored
Merge pull request #165 from adrianludwin/docs
Update docs for v1.0
2 parents e75b225 + c8073ee commit 2925068

File tree

5 files changed

+72
-77
lines changed

5 files changed

+72
-77
lines changed

README.md

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ pages](https://github.com/kubernetes-sigs/hierarchical-namespaces/releases/).
3030
Note that versions of HNC prior to HNC v0.9 are available from our [old
3131
repo](https://github.com/kubernetes-sigs/multi-tenancy/releases/).
3232

33-
HNC is also supported by the following vendors:
34-
35-
* GCP: as a part of Hierarchy Controller. [Install via Config
36-
Sync](https://cloud.google.com/kubernetes-engine/docs/add-on/config-sync/how-to/installing-hierarchy-controller)
37-
on GKE or [via
38-
ACM](https://cloud.google.com/anthos-config-management/docs/how-to/installing-hierarchy-controller)
39-
on Anthos.
40-
4133
Once HNC is installed, you can try out the [HNC
4234
quickstart](docs/user-guide/quickstart.md)
4335
to get an idea of what HNC can do. Or, feel free to dive right into the [user
@@ -48,14 +40,15 @@ guide](docs/user-guide) instead.
4840
Please file issues - the more the merrier! Bugs will be investigated ASAP, while
4941
feature requests will be prioritized and assigned to a milestone or backlog.
5042

51-
HNC is not yet GA, so please be cautious about using it on clusters with config
52-
objects you can't afford to lose (e.g. that aren't stored in a Git repository).
43+
Versions of HNC prior to v1.0 are not GA, so please be cautious about using it
44+
on clusters with config objects you can't afford to lose (e.g. that aren't
45+
stored in a Git repository).
5346

5447
All HNC issues are assigned to an HNC milestone. So far, the following
5548
milestones are defined or planned:
5649

5750
* [v1.0](https://github.com/kubernetes-sigs/hierarchical-namespaces/milestone/2):
58-
HNC recommended for production use (ETA late 2021)
51+
HNC recommended for production use (ETA April 2022)
5952
* [v0.9](https://github.com/kubernetes-sigs/hierarchical-namespaces/milestone/1):
6053
move HNC to its own repo; continued stability improvements.
6154
* [v0.1-v0.8](https://github.com/kubernetes-sigs/multi-tenancy/milestones):
@@ -67,6 +60,11 @@ HNC is overseen by the Working Group on Multi-Tenancy (wg-multitenancy). Please
6760
join us on Slack, mailing lists, and at our meeting at our [community
6861
page](https://github.com/kubernetes/community/blob/master/wg-multitenancy/README.md).
6962

63+
If you use HNC, we recommend joining the
64+
[kubernetes-hnc-announce](https://groups.google.com/g/kubernetes-hnc-announce)
65+
mailing list, a low-volume list to receive updates such as new version of HNC
66+
and proposed changes or new features.
67+
7068
This project is goverened by
7169
[wg-multitenancy](https://github.com/kubernetes-sigs/multi-tenancy), and was
7270
originally located in that repo. It moved to this location after approval by

docs/user-guide/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# HNC User Guide v0.9 (and v0.8)
1+
# HNC User Guide v1.0 (and v0.9)
22

33
Authors: [email protected] and other contributors from wg-multitenancy
44

@@ -12,8 +12,8 @@ This guide explains how to use hierarchical namespaces, explains some of the
1212
concepts behind them for a more in-depth understanding, and covers some best
1313
practices.
1414

15-
**Note: this doc covers HNC v0.9.x and v0.8.x.** For older versions of HNC,
16-
see below.
15+
**Note: this doc covers HNC v1.0.x and v0.9.x.** For older versions of HNC, see
16+
below.
1717

1818
## Table of contents
1919

@@ -25,8 +25,9 @@ see below.
2525

2626
## Older user guides
2727

28-
* [HNC v0.7](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.7/docs/user-guide)
29-
* [HNC v0.6](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.6/docs/user-guide)
30-
* [HNC v0.5](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.5/docs/user-guide)
31-
* [HNC v0.4](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.4/docs/user-guide)
28+
* [HNC v0.8](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.8/incubator/hnc/docs/user-guide)
29+
* [HNC v0.7](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.7/incubator/hnc/docs/user-guide)
30+
* [HNC v0.6](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.6/incubator/hnc/docs/user-guide)
31+
* [HNC v0.5](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.5/incubator/hnc/docs/user-guide)
32+
* [HNC v0.4](https://github.com/kubernetes-sigs/multi-tenancy/tree/hnc-v0.4/incubator/hnc/docs/user-guide)
3233
* [HNC v0.3](https://docs.google.com/document/d/1XVVv1ha4j1WUaszu3mmlACeWPUJXbJhA6zntxswrsco)

docs/user-guide/concepts.md

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -502,9 +502,9 @@ problem, and will generally require human intervention to resolve.
502502

503503
<a name="admin-managed-labels"/>
504504

505-
### Managed labels and annotations
505+
### (Beta) Managed labels and annotations
506506

507-
***Managed labels and annotations are planned for HNC v1.0+***
507+
***Managed labels and annotations are new in HNC v1.0; please use with caution.***
508508

509509
Just as certain objects can be propagated from parent namespaces to their
510510
descendants, so can certain labels and annotations on namespaces. For example,
@@ -577,17 +577,6 @@ namespace if this annotation already exists. The two are mutually exclusive.
577577
We are considering replacing this with the standard
578578
`app.kubernetes.io/managed-by` label in the future.
579579

580-
<a name="excluded-namespace-label">
581-
582-
#### hnc.x-k8s.io/excluded-namespace (label on namespaces)
583-
584-
***This label is only used in HNC v0.8 (not applicable in HNC v0.9 and later)***
585-
586-
This label should be added to namespaces such as `kube-system` and `kube-public`
587-
so that HNC's validating webhook cannot accidentally prevent operations in these
588-
namespaces and block critical cluster operations. See [Excluding namespaces from
589-
HNC](how-to.md#admin-excluded-namespaces) for more information.
590-
591580
<a name="admin-labels-set">
592581

593582
### Labels and annotations set by HNC
@@ -664,8 +653,6 @@ anyone other than HNC.
664653

665654
#### hnc.x-k8s.io/included-namespace (label on namespaces)
666655

667-
***This label is only available in HNC v0.9 and later***
668-
669656
HNC's mutating webhook sets this label on non-excluded namespaces by default.
670657
HNC also rejects any illegal changes on this label, e.g. adding the label to an
671658
excluded namespace or removing the label from a non-excluded namespace. This

docs/user-guide/faq.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@ Please feel free to suggest additional questions.
88
You can contact us on:
99

1010
* [Github issues](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues)
11-
* [Google Groups mailing list](https://groups.google.com/forum/#!forum/kubernetes-wg-multitenancy)
11+
* [Google Groups mailing list](https://groups.google.com/g/kubernetes-wg-multitenancy)
1212
* [#wg-multitenancy on Slack](https://kubernetes.slack.com/messages/wg-multitenancy)
1313

1414
Of these, Github and the mailing list will often get you the fastest response
1515
we're not constantly on Slack.
1616

17+
If you use HNC, we recommend joining the
18+
[kubernetes-hnc-announce](https://groups.google.com/g/kubernetes-hnc-announce)
19+
mailing list, a low-volume list to receive updates such as new version of HNC
20+
and proposed changes or new features.
21+
1722
## What are HNC's minimum requirements?
1823

1924
HNC technically requires Kubernetes 1.16 or higher, although we don't test on

docs/user-guide/how-to.md

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -405,34 +405,52 @@ EOF
405405

406406
<a name="use-managed-labels"/>
407407

408-
### Add a label or annotation to all namespaces in a subtree
408+
### (Beta) Add a label or annotation to all namespaces in a subtree
409409

410-
***Managed labels and annotations are planned for HNC v1.0+***
410+
***Managed labels and annotations are new in HNC v1.0; please use with caution.***
411411

412412
If your administrator has [created managed labels or
413-
annotations](#admin-managed-labels), you may set them on any namespace where you
414-
have permission to edit the `hierarchyconfigurations/hierarchy` object. For
415-
example, if your admin has set `env` as a managed label, you may set it on your
416-
namespace as follows:
413+
annotations](#admin-managed-labels), you may set them on any _full_ namespace
414+
where you have permission to edit the `hierarchyconfigurations/hierarchy`
415+
object. For example, if your admin has set `env` as a managed label, you may set
416+
it on your namespace as follows:
417417

418418
```
419419
apiVersion: hnc.x-k8s.io/v1alpha2
420420
kind: HierarchyConfiguration
421421
metadata:
422422
name: hierarchy
423423
namespace: child
424-
< other stuff >
424+
... < other stuff > ...
425425
spec:
426426
labels: # add
427427
- key: env # add
428428
value: prod # add
429429
```
430430

431-
You may similarly set managed annotations via the `.spec.annotations` list. Note
432-
that any label or annotation that conflicts with one set in an ancestor
433-
namespace will be silently ignored (this will eventually
431+
You may similarly set managed annotations via the `.spec.annotations` list.
432+
433+
For subnamespaces, you must set managed labels/annotations on the anchor in the
434+
parent namespace; any changes you make to the `HierarchyConfiguration` will be
435+
ignored and overwritten. The format on the anchors is the same as on the config:
436+
437+
```
438+
apiVersion: hnc.x-k8s.io/v1alpha2
439+
kind: SubnamespaceAnchor
440+
metadata:
441+
name: subns-name
442+
namespace: subns-parent
443+
... < other stuff > ...
444+
spec:
445+
labels: # add
446+
- key: env # add
447+
value: prod # add
448+
```
449+
450+
Note that any label or annotation that conflicts with one set in an ancestor
451+
namespace will be silently ignored. This will eventually
434452
[be](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/143)
435-
[improved](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/144)).
453+
[improved](https://github.com/kubernetes-sigs/hierarchical-namespaces/issues/144).
436454

437455
<a name="admin"/>
438456

@@ -448,24 +466,14 @@ and webhooks) that were only introduced in v1.16.
448466
There is no need to uninstall HNC before upgrading it unless specified in the
449467
release notes for that version.
450468

469+
_Note: HNC has **experimental** support for HA deployments in v1.0. Please
470+
contact us on Slack to discuss if you want to try it out._
471+
451472
#### Prerequisites
452473

453474
Ensure `kube-system`, `kube-public` and `kube-node-lease` namespaces are listed
454475
in the [argument list](#admin-cli-args) with the option `--excluded-namespace`.
455476

456-
**In HNC v0.8 (not applicable in HNC v0.9 and later)**, prior to installing HNC,
457-
add the `hnc.x-k8s.io/excluded-namespaces` label to your critical system
458-
namespaces:
459-
460-
```
461-
kubectl label ns kube-system hnc.x-k8s.io/excluded-namespace=true
462-
kubectl label ns kube-public hnc.x-k8s.io/excluded-namespace=true
463-
kubectl label ns kube-node-lease hnc.x-k8s.io/excluded-namespace=true
464-
```
465-
466-
Failure to do so may result in HNC being unable to start, and your cluster's
467-
operations being degraded until you delete HNC or apply the labels.
468-
469477
If you wish, you may also [exclude additional namespaces from
470478
HNC](#admin-excluded-namespaces), but be aware that only the three namespaces
471479
listed above can be excluded _by default_.
@@ -505,7 +513,7 @@ make deploy
505513
To temporarily disable HNC, simply delete its deployment and webhooks:
506514

507515
```bash
508-
kubectl -n hnc-system delete deployment hnc-controller-manager
516+
kubectl -n hnc-system delete deployment --all
509517
kubectl delete validatingwebhookconfiguration.admissionregistration.k8s.io hnc-validating-webhook-configuration
510518
```
511519

@@ -534,16 +542,16 @@ relationships and configuration settings:
534542
# the finalizers first.
535543
kubectl get crds | grep .hnc.x-k8s.io | awk '{print $1}' | xargs kubectl delete crd
536544

537-
# Delete the rest of HNC.
545+
# Delete the rest of HNC. For HNC v1.0 and later:
546+
kubectl delete -f https://github.com/kubernetes-sigs/hierarchical-namespaces/releases/download/hnc-${HNC_VERSION}/default.yaml
547+
# For versions earlier than HNC v1.0:
538548
kubectl delete -f https://github.com/kubernetes-sigs/hierarchical-namespaces/releases/download/hnc-${HNC_VERSION}/hnc-manager.yaml
539549
```
540550

541551
<a name="admin-excluded-namespaces"/>
542552

543553
### Including and excluding namespaces from HNC
544554

545-
***Included namespaces are only available in HNC v0.9 and higher.***
546-
547555
HNC installs a validating webhook on _all_ objects in your cluster. If HNC
548556
itself is damaged or inaccessible, this could result in all changes to all
549557
objects in your cluster being rejected, making it difficult to repair your
@@ -560,7 +568,7 @@ protecting your cluster's stability.
560568
HNC supports two methods of specifying which namespaces should be managed, both
561569
of which are accessed from the HNC [argument list](#admin-cli-args):
562570

563-
* **Included namespace regex (HNC v0.9+ only):** If set, this will limit HNC to
571+
* **Included namespace regex:** If set, this will limit HNC to
564572
only cover the namespaces included in this regex. For example, setting this
565573
parameter to `test-.*` will ensure that HNC only manages namespaces that begin
566574
with the prefix `test-` (HNC adds an implied `^...$` to the regex). If
@@ -575,14 +583,6 @@ of which are accessed from the HNC [argument list](#admin-cli-args):
575583
`--excluded-namespace` option, which can be specified multiple times, one
576584
namespace per option.
577585

578-
**In HNC v0.8 only (not applicable in HNC v0.9 and later):** In addition to
579-
specifying excluded namespaces on the command line, you must _also_ add the
580-
`hnc.x-k8s.io/excluded-namespace=true` label to all excluded namespaces, _after_
581-
you have restarted HNC with the correct parameter. If you attempt to apply this
582-
label to any namespace that is not _also_ listed in the command line args, HNC
583-
will not allow the change, or will remove the label when it is started. This
584-
label has no effect in HNC v0.9 or later.
585-
586586

587587
<a name="admin-backup-restore"/>
588588

@@ -759,9 +759,10 @@ edit the `config` object directly, which will bypass this protection.
759759

760760
761761

762-
### Ask HNC to manage certain labels and annotations
762+
### (Beta) Ask HNC to manage certain labels and annotations
763763

764-
***Managed labels and annotations are planned for HNC v1.0+***
764+
***Managed labels and annotations are new in HNC v1.0; please use with
765+
caution.***
765766

766767
See [here](concepts.md#admin-managed-labels) for the background on managed
767768
labels and annotations. In order to get HNC to manage a label or annotation, use
@@ -881,9 +882,10 @@ gcloud auth list
881882
## Modify command-line arguments
882883

883884
HNC's default manifest file (available as part of each release with the name
884-
`hnc-manager.yaml`) includes a set of reasonable default command-line arguments
885-
for HNC. These parameters are part of the `hnc-controller-manager` Deployment
886-
object in the `hnc-system` namespace.
885+
`hnc-manager.yaml` prior to HNC v1.0, and `default.yaml` after HNC v1.0)
886+
includes a set of reasonable default command-line arguments for HNC. These
887+
parameters are part of the `hnc-controller-manager` Deployment object in the
888+
`hnc-system` namespace.
887889

888890
To modify these parameters, you may:
889891

@@ -897,12 +899,14 @@ with significant caution.
897899

898900
Interesting parameters include:
899901

900-
* `--included-namespace-regex=` (HNC v0.9+ only): limits which
902+
* `--included-namespace-regex=`: limits which
901903
namespaces are [managed by HNC](#admin-excluded-namespaces). Defaults to `.*`,
902904
and may only be specified once.
903905
* `--excluded-namespace=`: allows you to
904906
[exclude a namespace](#admin-excluded-namespaces) from HNC. May be specified
905907
multiple times, one namespace per option.
908+
* `--managed-namespace-label` and `--managed-namespace-annotation`: see [managed
909+
labels and annotations](#admin-managed-labels).
906910
* `--unpropagated-annotation=`: empty by default, this argument
907911
can be specified multiple times, with each parameter representing an
908912
annotation name, such as `example.com/foo`. When HNC propagates objects from

0 commit comments

Comments
 (0)