Skip to main content

Speed up Load Balancer updates for multi-port Services

Each port of a type: LoadBalancer Service maps to one pool on the Load Balancer. When the cluster's nodes change (nodes added or removed, autoscaling, node pool upgrades), the backend list of every pool must be updated.

By default, pools are updated one at a time, so the more ports a Service has, the longer the update takes. With the batch-update-strategy annotation enabled, the backends of all pools are updated together in a single operation. The Load Balancer applies the new configuration only once, which significantly shortens the time it takes for the backends to match the new nodes on Services with many ports.

When to enable it​

Enable it when:

  • The Service has multiple ports, and
  • The cluster's nodes change frequently (autoscaler enabled, node pool scaling, regular upgrades).

There is no meaningful difference for a Service with a single port.

Enable the annotation​

Add the annotation with the value "true" to the Service:

apiVersion: v1
kind: Service
metadata:
name: web
annotations:
loadbalancer.fptcloud.com/batch-update-strategy: "true"
spec:
type: LoadBalancer
ports:
- name: http
port: 80
targetPort: 8080
- name: https
port: 443
targetPort: 8443

Or enable it on a running Service:

kubectl annotate service web loadbalancer.fptcloud.com/batch-update-strategy="true" --overwrite
note
  • Only the exact lowercase string "true" enables the feature. Values such as "True", "yes" or "1" are treated as disabled.
  • You do not need to recreate the Service or the Load Balancer. The change takes effect from the next Load Balancer update.
  • Enabling or disabling the annotation does not delete or recreate existing backends and causes no disruption.

Disable the annotation​

Remove the annotation, or set it to "false":

kubectl annotate service web loadbalancer.fptcloud.com/batch-update-strategy-

The Service returns to the default pool-by-pool update.

Check the result​

View the Service's events:

kubectl describe service web

When everything works normally, there are no related warning events. Possible events:

Event (Warning)MeaningWhat to do
LoadBalancerBatchUpdateSkippedThe annotation was ignored and the Service is still updated the default way, usually because the Load Balancer is shared by several ServicesNothing required. The feature applies only to a Load Balancer dedicated to one Service
LoadBalancerBatchUpdateFallbackThe region or the Load Balancer does not yet support updating all pools at once. The system automatically falls back to the pool-by-pool update for that run and retries laterNothing required. Backends are still updated normally
LoadBalancerBatchUpdateEmptyMembersThe node IP addresses to use as backends could not be determined. The system keeps the current backends to avoid losing connections and retries automaticallyCheck node status (kubectl get nodes -o wide). If it persists, contact support
LoadBalancerBatchUpdateFailedThe Load Balancer returned an error while applying the new configuration. The system retries automaticallyIf the event keeps repeating, contact FPT Cloud support with the Service name and namespace

Limitations​

  • The feature only changes how backends are updated on an existing Load Balancer. Listeners, health checks and the Load Balancer IP are not changed.
  • The end result is identical to the default update: the same backend list with the same attributes.
  • Services without the annotation behave as before and are not affected.
  • A Load Balancer shared by several Services (annotation loadbalancer.fptcloud.com/load-balancer-id) does not support this feature.
  • Creating a new Service already creates all backends in a single operation, so the annotation only takes effect on subsequent updates.

FAQ​

Does enabling the annotation disrupt my application? No. Existing backends are kept; only the nodes that changed are added or removed.

What happens if I mistype the annotation value? Any value other than "true" is treated as disabled. The Service keeps updating the default way, with no risk of losing backends.

What if my region does not support it yet? The system automatically falls back to the default update and backends are still updated. You can keep the annotation; it takes effect automatically once your region supports it.

What permissions do I need to enable it? update or patch permission on Services in the namespace, the same as for editing any Service.