Skip to content

Commit

Permalink
Add note regarding feature gate deletion
Browse files Browse the repository at this point in the history
Signed-off-by: abhiraut <rauta@vmware.com>
  • Loading branch information
abhiraut committed Aug 12, 2021
1 parent 89f4869 commit d77b65a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions docs/antrea-network-policy.md
Original file line number Diff line number Diff line change
Expand Up @@ -841,9 +841,9 @@ as opposed to using the `labels` associated with the Namespaces.

### K8s clusters with version 1.21 and above

Starting with K8s v1.21, all Namespaces will be labeled with `kubernetes.io/metadata.name: <namespaceName>` [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#automatic-labelling)
provided that the `NamespaceDefaultLabelName` feature gate is enabled. K8s NetworkPolicy
and Antrea-native policy users can take advantage of this reserved label
Starting with K8s v1.21, all Namespaces are labeled with the `kubernetes.io/metadata.name: <namespaceName>` [label](https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/#automatic-labelling)
provided that the `NamespaceDefaultLabelName` feature gate (enabled by default) is not disabled in K8s.
K8s NetworkPolicy and Antrea-native policy users can take advantage of this reserved label
to select Namespaces directly by their `name` in `namespaceSelectors` as follows:

```yaml
Expand Down Expand Up @@ -872,6 +872,9 @@ spec:
name: AllowToCoreDNS
```

**Note**: `NamespaceDefaultLabelName` feature gate is scheduled to be removed in K8s v1.24, thereby
ensuring that labeling Namespaces by their name cannot be disabled.

### K8s clusters with version 1.20 and below

In order to select Namespaces by name, Antrea labels Namespaces with a reserved label `antrea.io/metadata.name`,
Expand Down

0 comments on commit d77b65a

Please sign in to comment.