From c2df21af41cff7f3ba3f92550faaf6f74864761a Mon Sep 17 00:00:00 2001 From: Xudong Liu Date: Tue, 16 Mar 2021 17:59:21 -0700 Subject: [PATCH 1/6] add documentation for Service LoadBalancerClass --- .../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 5500c19412..a26a9ebd38 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 @@ -160,6 +160,7 @@ different Kubernetes components. | `ServerSideApply` | `false` | Alpha | 1.14 | 1.15 | | `ServerSideApply` | `true` | Beta | 1.16 | | | `ServiceLBNodePortControl` | `false` | Alpha | 1.20 | | +| `ServiceLoadBalancerClass` | `false` | Alpha | 1.21 | | | `ServiceNodeExclusion` | `false` | Alpha | 1.8 | 1.18 | | `ServiceNodeExclusion` | `true` | Beta | 1.19 | | | `ServiceTopology` | `false` | Alpha | 1.17 | | @@ -729,6 +730,7 @@ Each feature gate is designed for enabling/disabling a specific feature: - `ServiceAppProtocol`: Enables the `AppProtocol` field on Services and Endpoints. - `ServiceLBNodePortControl`: Enables the `spec.allocateLoadBalancerNodePorts` field on Services. +- `ServiceLoadBalancerClass`: Enables the `LoadBalancerClass` 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 From 119233c47baddb7f8c3e96b143bb74e36aad4767 Mon Sep 17 00:00:00 2001 From: Xudong Liu Date: Mon, 22 Mar 2021 16:38:03 -0700 Subject: [PATCH 2/6] add KEP link for loadBalancerClass --- .../reference/command-line-tools-reference/feature-gates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a26a9ebd38..68ea25e628 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 @@ -730,7 +730,7 @@ Each feature gate is designed for enabling/disabling a specific feature: - `ServiceAppProtocol`: Enables the `AppProtocol` field on Services and Endpoints. - `ServiceLBNodePortControl`: Enables the `spec.allocateLoadBalancerNodePorts` field on Services. -- `ServiceLoadBalancerClass`: Enables the `LoadBalancerClass` field on Services. +- `ServiceLoadBalancerClass`: Enables the `LoadBalancerClass` field on Services. See [Service Type=LoadBalancer Class Field](https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/1959-service-lb-class-field) for more details. - `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 From 3c1216c7cec81c2690a2a7279a6bfb254a368061 Mon Sep 17 00:00:00 2001 From: Harold Date: Sat, 27 Mar 2021 17:38:42 -0700 Subject: [PATCH 3/6] Add detail documentation for service LoadBalancerClass --- content/en/docs/concepts/services-networking/service.md | 9 +++++++++ .../command-line-tools-reference/feature-gates.md | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index b7a7edcd38..3bd6709fa0 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -628,6 +628,15 @@ is set to `false` on an existing Service with allocated node ports, those node p 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. +#### Specifying class of load balancer implementation {#load-balancer-class} + +{{< feature-state for_k8s_version="v1.21" state="alpha" >}} + +Starting in v1.21, you can optionally specify class of load balancer implementation for a Service Type=LoadBalancer by setting field `spec.loadBalancerClass` value. By default, `spec.loadBalancerClass` is `nil` and type LoadBalacner Services will use the cloud providers' default load balancer implementation. +If `spec.loadBalancerClass` is specified, it is assumed that a matching class load balancer implementation is watching for Services and any default load balancer implementation (e.g. cloud providers) will ignore Services that set this field. `spec.loadBalancerClass` can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. +The value of `spec.loadBalancerClass` must be a label-style identifier, with an optional prefix, e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. +You must enable the `ServiceLoadBalancerClass` feature gate to use this field. + #### Internal load balancer In a mixed environment it is sometimes necessary to route traffic from Services inside the same 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 68ea25e628..019b9ff8ee 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 @@ -730,7 +730,7 @@ Each feature gate is designed for enabling/disabling a specific feature: - `ServiceAppProtocol`: Enables the `AppProtocol` field on Services and Endpoints. - `ServiceLBNodePortControl`: Enables the `spec.allocateLoadBalancerNodePorts` field on Services. -- `ServiceLoadBalancerClass`: Enables the `LoadBalancerClass` field on Services. See [Service Type=LoadBalancer Class Field](https://github.com/kubernetes/enhancements/tree/master/keps/sig-cloud-provider/1959-service-lb-class-field) for more details. +- `ServiceLoadBalancerClass`: Enables the `LoadBalancerClass` field on Services. See [Specifying class of load balancer implementation](/docs/concepts/services-networking/service/#specifying-class-of-load-balancer-implementation-load-balancer-class) for more details. - `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 From 81b8394561bf8a88f647550f09946c164e34c150 Mon Sep 17 00:00:00 2001 From: Xudong Liu <7lxd@tongji.edu.cn> Date: Sun, 28 Mar 2021 21:35:20 -0700 Subject: [PATCH 4/6] Update content/en/docs/concepts/services-networking/service.md Co-authored-by: Qiming Teng --- content/en/docs/concepts/services-networking/service.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index 3bd6709fa0..05d91e075a 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -632,7 +632,10 @@ You must enable the `ServiceLBNodePortControl` feature gate to use this field. {{< feature-state for_k8s_version="v1.21" state="alpha" >}} -Starting in v1.21, you can optionally specify class of load balancer implementation for a Service Type=LoadBalancer by setting field `spec.loadBalancerClass` value. By default, `spec.loadBalancerClass` is `nil` and type LoadBalacner Services will use the cloud providers' default load balancer implementation. +Starting in v1.21, you can optionally specify the class of a load balancer implementation for +`LoadBalancer` type of Service by setting the field `spec.loadBalancerClass`. +By default, `spec.loadBalancerClass` is `nil` and a `LoadBalancer` type of Service uses +the cloud provider's default load balancer implementation. If `spec.loadBalancerClass` is specified, it is assumed that a matching class load balancer implementation is watching for Services and any default load balancer implementation (e.g. cloud providers) will ignore Services that set this field. `spec.loadBalancerClass` can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. The value of `spec.loadBalancerClass` must be a label-style identifier, with an optional prefix, e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. You must enable the `ServiceLoadBalancerClass` feature gate to use this field. From 469b890e6c9d4270662884f778d910072cb96f4c Mon Sep 17 00:00:00 2001 From: Xudong Liu <7lxd@tongji.edu.cn> Date: Sun, 28 Mar 2021 21:35:31 -0700 Subject: [PATCH 5/6] Update content/en/docs/concepts/services-networking/service.md Co-authored-by: Qiming Teng --- content/en/docs/concepts/services-networking/service.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index 05d91e075a..8c3b5c40ac 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -636,7 +636,12 @@ Starting in v1.21, you can optionally specify the class of a load balancer imple `LoadBalancer` type of Service by setting the field `spec.loadBalancerClass`. By default, `spec.loadBalancerClass` is `nil` and a `LoadBalancer` type of Service uses the cloud provider's default load balancer implementation. -If `spec.loadBalancerClass` is specified, it is assumed that a matching class load balancer implementation is watching for Services and any default load balancer implementation (e.g. cloud providers) will ignore Services that set this field. `spec.loadBalancerClass` can only be set when creating or updating a Service to type 'LoadBalancer'. Once set, it can not be changed. +If `spec.loadBalancerClass` is specified, it is assumed that a load balancer +implementation that matches the specified class is watching for Services. +Any default load balancer implementation (for example, the one provided by +the cloud provider) will ignore Services that have this field set. +`spec.loadBalancerClass` can be set on a Service of type `LoadBalancer` only. +Once set, it cannot be changed. The value of `spec.loadBalancerClass` must be a label-style identifier, with an optional prefix, e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. You must enable the `ServiceLoadBalancerClass` feature gate to use this field. From fcfcc73a00a5a66449c4718eada8e77b307960b2 Mon Sep 17 00:00:00 2001 From: Xudong Liu <7lxd@tongji.edu.cn> Date: Sun, 28 Mar 2021 21:35:41 -0700 Subject: [PATCH 6/6] Update content/en/docs/concepts/services-networking/service.md Co-authored-by: Qiming Teng --- content/en/docs/concepts/services-networking/service.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index 8c3b5c40ac..dd0925eae0 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -642,7 +642,9 @@ Any default load balancer implementation (for example, the one provided by the cloud provider) will ignore Services that have this field set. `spec.loadBalancerClass` can be set on a Service of type `LoadBalancer` only. Once set, it cannot be changed. -The value of `spec.loadBalancerClass` must be a label-style identifier, with an optional prefix, e.g. "internal-vip" or "example.com/internal-vip". Unprefixed names are reserved for end-users. +The value of `spec.loadBalancerClass` must be a label-style identifier, +with an optional prefix such as "`internal-vip`" or "`example.com/internal-vip`". +Unprefixed names are reserved for end-users. You must enable the `ServiceLoadBalancerClass` feature gate to use this field. #### Internal load balancer