You can use the feature for sharing the same CLB among multiple Services to support the simultaneous opening of TCP and UDP on the same port for the same VIP.
This feature is not recommended for other scenarios.
- For clusters created before Aug. 17, 2020, the CLBs created by their Services support the sharing of the same CLB by default.
For a cluster where the CLB sharing feature is enabled, the CLBs created by its Services are configured with the
<serviceuuid>_<lb_listener_id>:<lb_listener_id> tags by default. Each CLB has its own key and value, so there are many tags. You can submit a ticket to request that we disable the CLB sharing feature for this kind of cluster and clear the tags.
- For clusters created after Aug. 17, 2020, the feature of multiple Services sharing the same CLB is disabled by default.
For a cluster where the CLB sharing feature is disabled, the CLBs created by its Services are configured with the
tke-lb-serviceuuid:<serviceuuid> tag by default. All Services use the same batch of tag keys, and the number of tag keys can be controlled. You can submit a ticket to request that we enable the CLB sharing feature.
- In a scenario where multiple Services share the same CLB, the number of listeners managed by a single CLB cannot exceed 10.
- In scenarios where a Service is reused, only the user-created Cloud Load Balancer (CLB) can be used. This is because when the CLB created in the TKE cluster is reused, CLB resources may not be released, leading to a resource leak.
- To reuse CLB resources created by the current TKE, you can add
service.kubernetes.io/tke-existed-lbid annotation to the current Service, and delete the
tke-createdBy-flag = yes tag of this CLB.
After reusing CLB resources created by the current TKE, you need to manually manage the CLB resources, because the CLB's life cycle will not be controlled by the TKE due to the lack of the tag.
- Refer to Creating CLB Instances to create a CLB for the public or private network of the VPC where the cluster is located.
- Refer to Creating a Deployment or Creating a Service to create a Service of the Loadbalancer type. Select Use Existing for Load Balancer and choose the CLB instance created in Step 1, as shown in the following figure.
- Repeat Step 2 to reuse the same CLB for multiple Services.