From e9ea77ef1e8e73d22c2d5f21390bd6d8f6ebea46 Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Tue, 24 Nov 2020 21:37:58 -0500 Subject: [PATCH 1/3] fix trailing spaces in Service docs Signed-off-by: Andrew Sy Kim --- content/en/docs/concepts/services-networking/service.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index 24c1ef27be..3f929bb38e 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -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 >}} From acb476bec45c6abd18d496525d265c767615f3ca Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Tue, 24 Nov 2020 21:38:13 -0500 Subject: [PATCH 2/3] add docs for service.spec.allocateLoadBalancerNodePorts Signed-off-by: Andrew Sy Kim --- .../en/docs/concepts/services-networking/service.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index 3f929bb38e..58d9bb9a2d 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -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 From 9949da14ca10ab0a72e76e8115f9f67a2bbe333e Mon Sep 17 00:00:00 2001 From: Andrew Sy Kim Date: Sat, 28 Nov 2020 09:52:22 -0500 Subject: [PATCH 3/3] add feature gate docs for ServiceLBNodePortControl Signed-off-by: Andrew Sy Kim --- .../reference/command-line-tools-reference/feature-gates.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/en/docs/reference/command-line-tools-reference/feature-gates.md b/content/en/docs/reference/command-line-tools-reference/feature-gates.md index 6201319082..a32b458a75 100644 --- a/content/en/docs/reference/command-line-tools-reference/feature-gates.md +++ b/content/en/docs/reference/command-line-tools-reference/feature-gates.md @@ -153,6 +153,7 @@ different Kubernetes components. | `ServerSideApply` | `false` | Alpha | 1.14 | 1.15 | | `ServerSideApply` | `true` | Beta | 1.16 | | | `ServiceAccountIssuerDiscovery` | `false` | Alpha | 1.18 | | +| `ServiceLBNodePortControl` | `false` | Alpha | 1.20 | 1.20 | | `ServiceNodeExclusion` | `false` | Alpha | 1.8 | 1.18 | | `ServiceNodeExclusion` | `true` | Beta | 1.19 | | | `ServiceTopology` | `false` | Alpha | 1.17 | | @@ -552,6 +553,7 @@ Each feature gate is designed for enabling/disabling a specific feature: - `ServerSideApply`: Enables the [Sever Side Apply (SSA)](/docs/reference/using-api/server-side-apply/) path at the API Server. - `ServiceAccountIssuerDiscovery`: Enable OIDC discovery endpoints (issuer and JWKS URLs) for the service account issuer in the API server. See [Configure Service Accounts for Pods](/docs/tasks/configure-pod-container/configure-service-account/#service-account-issuer-discovery) for more details. - `ServiceAppProtocol`: Enables the `AppProtocol` field on Services and Endpoints. +- `ServiceLBNodePortControl`: Enables the `spec.allocateLoadBalancerNodePorts` field on Services. - `ServiceLoadBalancerFinalizer`: Enable finalizer protection for Service load balancers. - `ServiceNodeExclusion`: Enable the exclusion of nodes from load balancers created by a cloud provider. A node is eligible for exclusion if labelled with "`alpha.service-controller.kubernetes.io/exclude-balancer`" key or `node.kubernetes.io/exclude-from-external-load-balancers`.