From c8acb6d45f20a717fa7d467253c3367726594b70 Mon Sep 17 00:00:00 2001 From: Zihong Zheng Date: Thu, 23 May 2019 12:38:56 -0700 Subject: [PATCH] Add a section for service load balancer cleanup --- .../concepts/services-networking/service.md | 2 ++ .../create-external-load-balancer.md | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/content/en/docs/concepts/services-networking/service.md b/content/en/docs/concepts/services-networking/service.md index a6bc859b79cab..08e6fd9ff4af4 100644 --- a/content/en/docs/concepts/services-networking/service.md +++ b/content/en/docs/concepts/services-networking/service.md @@ -419,6 +419,8 @@ and `.spec.clusterIP:spec.ports[*].port`. (If the `--nodeport-addresses` flag in ### Type LoadBalancer {#loadbalancer} +TODO(@MrHohn): Placeholder for load balancer finalizer feature + On cloud providers which support external load balancers, setting the `type` field to `LoadBalancer` will provision a load balancer for your `Service`. The actual creation of the load balancer happens asynchronously, and diff --git a/content/en/docs/tasks/access-application-cluster/create-external-load-balancer.md b/content/en/docs/tasks/access-application-cluster/create-external-load-balancer.md index b8a5b1c35280d..39b5cc4dc7d60 100644 --- a/content/en/docs/tasks/access-application-cluster/create-external-load-balancer.md +++ b/content/en/docs/tasks/access-application-cluster/create-external-load-balancer.md @@ -194,6 +194,24 @@ Known issues: {{% capture discussion %}} +## Load Balancer cleanup + +In usual case, the correlating load balancer resources in cloud provider should +be cleaned up soon after a LoadBalancer type service is deleted. But it is known +that there are various corner cases where resources can be leaved orphaned after +a service is deleted. Finalizer Protection for Service LoadBalancers was +introduced to prevent this from happening. By using finalizer, this feature +makes sure service resource is not fully deleted until the correlating load +balancer resources are deleted. + +Specifically, a finalizer with name `"service.kubernetes.io/load-balancer-cleanup"` +will be attached to the service if any load balancer resource is created for it. +The finalizer will only be removed after load balancer resource is cleaned up. +Above ensures resource won't be leaked even in corner cases. + +This feature was introduced as Alpha in kubernetes v1.15. It can be enabled via +feature gate `ServiceLoadBalancerFinalizer=true`. + ## External Load Balancer Providers It is important to note that the datapath for this functionality is provided by a load balancer external to the Kubernetes cluster.