@@ -366,7 +366,17 @@ can use any of the following annotations:
366
366
367
367
* ** ` propagate.hnc.x-k8s.io/none ` ** : Setting ` none ` to ` true ` (case insensitive)
368
368
will result in the object not propagating to _ any_ descendant namespace. Any
369
- other value will be rejected.
369
+ other value will be rejected. This is only useful in ` Propagate `
370
+ [ synchronization mode] ( #modify-the-resources-propagated-by-hnc ) .
371
+
372
+ * ** ` propagate.hnc.x-k8s.io/all ` ** : Setting ` all ` to ` true ` (case insensitive)
373
+ will result in the object propagating to _ any_ descendant namespace. Any
374
+ other value will be rejected. This is only useful in ` AllowPropagate `
375
+ [ synchronization mode] ( #modify-the-resources-propagated-by-hnc ) .
376
+
377
+ Warning: only use one of the propagation annotations on any one object at a time.
378
+ Interactions between multiple propagation annotations is undefined and may change
379
+ from release to release.
370
380
371
381
For example, consider a case with a parent namespace with three child
372
382
namespaces, and the parent namespace has a secret called ` my-secret ` . To set
@@ -382,12 +392,18 @@ kubectl annotate secret my-secret -n parent propagate.hnc.x-k8s.io/select=child1
382
392
kubectl annotate secret my-secret -n parent propagate.hnc.x-k8s.io/select=' !child2.tree.hnc.x-k8s.io/depth, !child3.tree.hnc.x-k8s.io/depth'
383
393
```
384
394
385
- To set ` my-secret ` not to propagate to any namespace, you can use:
395
+ To set ` my-secret ` not to propagate to any namespace when the sync mode is ` Propagate ` , you can use:
386
396
387
397
``` bash
388
398
kubectl annotate secret my-secret -n parent propagate.hnc.x-k8s.io/none=true
389
399
```
390
400
401
+ To set ` my-secret ` to propagate to any namespace when the sync mode is ` AllowPropagate ` , you can use:
402
+
403
+ ``` bash
404
+ kubectl annotate secret my-secret -n parent propagate.hnc.x-k8s.io/all=true
405
+ ```
406
+
391
407
All these are equivalent to creating the object with the selector annotations:
392
408
393
409
``` bash
@@ -677,6 +693,10 @@ The most important type of configuration is the way each object type
677
693
678
694
* ** Propagate:** propagates objects from ancestors to descendants and deletes
679
695
obsolete descendants.
696
+ * ** AllowPropagate:** inclusive propagation - only propagates objects from ancestors
697
+ to descendants and deletes obsolete descendants when at least one
698
+ [ selector] ( #limit-the-propagation-of-an-object-to-descendant-namespaces ) is set
699
+ on the object.
680
700
* ** Remove:** deletes all existing propagated copies, but does not touch source
681
701
objects.
682
702
* ** Ignore:** stops modifying this resource. New or changed objects will not be
@@ -700,7 +720,7 @@ To configure an object resource using the kubectl plugin:
700
720
701
721
```
702
722
# "--group" can be omitted if the resource is a core K8s resource
703
- kubectl hns config set-resource [resource] --group [group ] --mode [ Propagate|Remove|Ignore]
723
+ kubectl- hns config set-resource RESOURCE [ --group GROUP] [--force ] --mode < Propagate|Remove|Ignore|AllowPropagate>
704
724
```
705
725
706
726
For example:
@@ -737,20 +757,20 @@ spec:
737
757
mode : Propagate <<<
738
758
` ` `
739
759
740
- Adding a new resource in the ` Propagate` mode is potentially dangerous, since
741
- there could be existing objects of that resource type that would be overwritten
742
- by objects of the same name from ancestor namespaces. As a result, the HNS
743
- plugin will not allow you to add a new resource directly in the `Propagate`
744
- mode. Instead, to do so safely :
760
+ Adding a new resource in the ` Propagate` mode or `AllowPropagate` mode is potentially
761
+ dangerous, since there could be existing objects of that resource type that
762
+ would be overwritten by objects of the same name from ancestor namespaces.
763
+ As a result, the HNS plugin will not allow you to add a new resource directly
764
+ in the `Propagate` mode or `AllowPropagate` . Instead, to do so safely :
745
765
746
766
* Add the new resource in the `Remove` mode. This will remove any propagated
747
767
copies (of which there should be none) but will force HNC to start
748
768
synchronizing all known source objects.
749
769
* Wait until `kubectl hns config describe` looks like it's identified the
750
770
correct number of objects of the newly added resource in its status.
751
- * Change the propagation mode from `Remove` to `Propagate`. HNC will then check
752
- to see if any objects will be overwritten, and will not allow you to change
753
- the propagation mode until all such conflicts are resolved.
771
+ * Change the propagation mode from `Remove` to `Propagate` or `AllowPropagate`.
772
+ HNC will then check to see if any objects will be overwritten, and will not
773
+ allow you to change the propagation mode until all such conflicts are resolved.
754
774
755
775
Alternatively, if you're certain you want to start propagating objects
756
776
immediately, you can use the `--force` flag with `kubectl hns config
0 commit comments