Skip to content

Commit 92cc0c9

Browse files
committed
Add docs on configuring NodePort IP
1 parent 805f2c7 commit 92cc0c9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/concepts/services-networking/service.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ allocate a port from a flag-configured range (default: 30000-32767), and each
403403
Node will proxy that port (the same port number on every Node) into your `Service`.
404404
That port will be reported in your `Service`'s `spec.ports[*].nodePort` field.
405405

406+
If you want to specify particular IP(s) to proxy the port, you can set the `--nodeport-addresses` flag in kube-proxy to particular IP block(s) (which is supported since Kubernetes v1.10). A comma-delimited list of IP blocks (e.g. 10.0.0.0/8, 1.2.3.4/32) is used to filter addresses local to this node. For example, if you start kube-proxy with flag `--nodeport-addresses=127.0.0.0/8`, kube-proxy will select only the loopback interface for NodePort Services. The `--nodeport-addresses` is defaulted to empty (`[]`), which means select all available interfaces and is in compliance with current NodePort behaviors.
407+
406408
If you want a specific port number, you can specify a value in the `nodePort`
407409
field, and the system will allocate you that port or else the API transaction
408410
will fail (i.e. you need to take care about possible port collisions yourself).
@@ -413,7 +415,7 @@ configure environments that are not fully supported by Kubernetes, or
413415
even to just expose one or more nodes' IPs directly.
414416

415417
Note that this Service will be visible as both `<NodeIP>:spec.ports[*].nodePort`
416-
and `spec.clusterIP:spec.ports[*].port`.
418+
and `spec.clusterIP:spec.ports[*].port`. (If the `--nodeport-addresses` flag in kube-proxy is set, <NodeIP> would be filtered NodeIP(s).)
417419

418420
### Type LoadBalancer
419421

0 commit comments

Comments
 (0)