Skip to content

Commit 8a04ffe

Browse files
authored
Network Policy - EndPort to Beta (#28860)
* Move endPort field to beta and v1.22 * Add note about CNI not supporting endport
1 parent 50c97b2 commit 8a04ffe

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

content/en/docs/concepts/services-networking/network-policies.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ You must be using a {{< glossary_tooltip text="CNI" term_id="cni" >}} plugin tha
223223

224224
## Targeting a range of Ports
225225

226-
{{< feature-state for_k8s_version="v1.21" state="alpha" >}}
226+
{{< feature-state for_k8s_version="v1.22" state="beta" >}}
227227

228228
When writing a NetworkPolicy, you can target a range of ports instead of a single port.
229229

@@ -251,17 +251,25 @@ spec:
251251
endPort: 32768
252252
```
253253

254-
The above rule allows any Pod with label `db` on the namespace `default` to communicate with any IP within the range `10.0.0.0/24` over TCP, provided that the target port is between the range 32000 and 32768.
254+
The above rule allows any Pod with label `db` on the namespace `default` to communicate
255+
with any IP within the range `10.0.0.0/24` over TCP, provided that the target
256+
port is between the range 32000 and 32768.
255257

256258
The following restrictions apply when using this field:
257-
* As an alpha feature, this is disabled by default. To enable the `endPort` field at a cluster level, you (or your cluster administrator) need to enable the `NetworkPolicyEndPort` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) for the API server with `--feature-gates=NetworkPolicyEndPort=true,…`.
259+
* As a beta feature, this is enabled by default. To disable the `endPort` field
260+
at a cluster level, you (or your cluster administrator) need to disable the
261+
`NetworkPolicyEndPort` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/)
262+
for the API server with `--feature-gates=NetworkPolicyEndPort=false,…`.
258263
* The `endPort` field must be equal than or greater to the `port` field.
259264
* `endPort` can only be defined if `port` is also defined.
260265
* Both ports must be numeric.
261266

262267
{{< note >}}
263268
Your cluster must be using a {{< glossary_tooltip text="CNI" term_id="cni" >}} plugin that
264269
supports the `endPort` field in NetworkPolicy specifications.
270+
If your [network plugin](/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/)
271+
does not support the `endPort` field and you specify a NetworkPolicy with that,
272+
the policy will be applied only for the single `port` field.
265273
{{< /note >}}
266274

267275
## Targeting a Namespace by its name

0 commit comments

Comments
 (0)