Merge pull request #25228 from andrewsykim/disable-lb-node-ports

add docs for service.spec.allocateLoadBalancerNodePorts
This commit is contained in:
Kubernetes Prow Robot
2020-11-30 16:52:50 -08:00
committed by GitHub
2 changed files with 14 additions and 1 deletions
@@ -608,7 +608,7 @@ By default, for LoadBalancer type of Services, when there is more than one port
ports must have the same protocol, and the protocol must be one which is supported
by the cloud provider.
If the feature gate `MixedProtocolLBService` is enabled for the kube-apiserver it is allowed to use different protocols when there is more than one port defined.
If the feature gate `MixedProtocolLBService` is enabled for the kube-apiserver it is allowed to use different protocols when there is more than one port defined.
{{< note >}}
@@ -616,6 +616,17 @@ The set of protocols that can be used for LoadBalancer type of Services is still
{{< /note >}}
#### Disabling load balancer NodePort allocation {#load-balancer-nodeport-allocation}
{{< feature-state for_k8s_version="v1.20" state="alpha" >}}
Starting in v1.20, you can optionally disable node port allocation for a Service Type=LoadBalancer by setting
the field `spec.allocateLoadBalancerNodePorts` to `false`. This should only be used for load balancer implementations
that route traffic directly to pods as opposed to using node ports. By default, `spec.allocateLoadBalancerNodePorts`
is `true` and type LoadBalancer Services will continue to allocate node ports. If `spec.allocateLoadBalancerNodePorts`
is set to `false` on an existing Service with allocated node ports, those node ports will NOT be de-allocated automatically.
You must explicitly remove the `nodePorts` entry in every Service port to de-allocate those node ports.
You must enable the `ServiceLBNodePortControl` feature gate to use this field.
#### Internal load balancer