Skip to content

Commit

Permalink
Update docs for NodePortLocal
Browse files Browse the repository at this point in the history
* Update annotation example with new protocol field.
* Update NPL windows support feature.

Signed-off-by: Shuyang Xin <gavinx@vmware.com>
  • Loading branch information
XinShuYang committed May 29, 2022
1 parent afd00a5 commit e35ac0c
Showing 1 changed file with 38 additions and 5 deletions.
43 changes: 38 additions & 5 deletions docs/node-port-local.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- [What is NodePortLocal?](#what-is-nodeportlocal)
- [Prerequisites](#prerequisites)
- [Usage](#usage)
- [Usage pre Antrea v1.7](#usage-pre-antrea-v17)
- [Usage pre Antrea v1.4](#usage-pre-antrea-v14)
- [Usage pre Antrea v1.2](#usage-pre-antrea-v12)
- [Limitations](#limitations)
Expand All @@ -29,7 +30,7 @@ directly to backend Pods.
NodePortLocal was introduced in v0.13 as an alpha feature, and was graduated to
beta in v1.4, at which time it was enabled by default. Prior to v1.4, a feature
gate, `NodePortLocal`, must be enabled on the antrea-agent for the feature to
work.
work. Starting from Antrea v1.7, NPL is supported on the Windows antrea-agent.

## Usage

Expand Down Expand Up @@ -114,12 +115,12 @@ metadata:
labels:
app: nginx
annotations:
nodeportlocal.antrea.io: '[{"podPort":8080,"nodeIP":"10.10.10.10","nodePort":61002}]'
nodeportlocal.antrea.io: '[{"podPort":8080,"nodeIP":"10.10.10.10","nodePort":61002,"protocol":"tcp","protocols":["tcp"]}]'
...
```

This annotation indicates that port 8080 of the Pod can be reached through port
61002 of the Node with IP Address 10.10.10.10.
61002 of the Node with IP Address 10.10.10.10 for TCP traffic.

The `nodeportlocal.antrea.io` annotation is generated and managed by Antrea. It
is not meant to be created or modified by users directly. A user-provided
Expand All @@ -131,6 +132,38 @@ NodePortLocal can only be used with Services of type `ClusterIP` or
Services of type `NodePort` or `ExternalName`. The annotation also has no effect
for Services with an empty or missing Selector.

Starting from the Antrea v1.7 minor release, the `protocols` field in the
annotation is deprecated. The array contains a single member, equal to the
`protocol` field.
The `protocols` field will be removed from Antrea for minor releases post March 2023,
as per our deprecation policy.

### Usage pre Antrea v1.7

Prior to the Antrea v1.7 minor release, the `nodeportlocal.antrea.io` annotation
could contain multiple members in `protocols`.
An example may look like this:

```yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-6799fc88d8-9rx8z
labels:
app: nginx
annotations:
nodeportlocal.antrea.io: '[{"podPort":8080,"nodeIP":"10.10.10.10","nodePort":61002}, "protocols":["tcp","udp"]]'
...
```

This annotation indicates that port 8080 of the Pod can be reached through port
61002 of the Node with IP Address 10.10.10.10 for both TCP and UDP traffic.

Prior to v1.7, the implementation would always allocate the same nodePort value
for all the protocols exposed for a given podPort.
Starting with v1.7, there will be multiple annotations for the different protocols
for a given podPort, and the allocated nodePort may be different for each one.

### Usage pre Antrea v1.4

Prior to the Antrea v1.4 minor release, the `nodePortLocal` option group in the
Expand Down Expand Up @@ -179,8 +212,8 @@ mapped.

## Limitations

This feature is currently only supported for Nodes running Linux with IPv4
addresses. Only TCP & UDP Service ports are supported (not SCTP).
This feature is currently only supported for Nodes running Linux or Windows
with IPv4 addresses. Only TCP & UDP Service ports are supported (not SCTP).

## Integrations with External Load Balancers

Expand Down

0 comments on commit e35ac0c

Please sign in to comment.