Skip to content

Commit

Permalink
Add a section for service load balancer cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
MrHohn committed Jun 7, 2019
1 parent c7c55c5 commit c8acb6d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions content/en/docs/concepts/services-networking/service.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit c8acb6d

Please sign in to comment.