When you specify Type=LoadBalancer
for a Service, Cloud Controller Manager (CCM) creates and configures Server Load
Balancer (SLB) resources for the Service, including SLB instances, listeners, and
VServer groups. This topic describes the considerations for configuring a LoadBalancer
type Service and the policies that are used by CCM to update SLB resources.
Policies that are used by CCM to update SLB resources
Container Service for Kubernetes (ACK) allows you to specify an existing SLB instance for a Service. You can also use CCM to automatically create one for the Service. The two methods use different policies to update SLB resources. The following table describes the differences.
Resource object | Existing SLB instance | SLB instance created and managed by CCM |
---|---|---|
SLB | Use the following annotation to specify an existing SLB instance for a Service: service.beta.kubernetes.io/alibaba-cloud-loadbalancer-id
|
|
Listener | Use the following annotation to configure listeners: service.beta.kubernetes.io/alibaba-cloud-loadbalancer-force-override-listeners: .
|
CCM configures listeners for the SLB instance based on the Service configuration. |
VServer group | When the endpoint of an Elastic Compute Service (ECS) instance in a VServer group
for a Service changes or the cluster nodes are changed, CCM updates the VServer groups.
|
Considerations for reusing an existing SLB instance
- Before you reuse an existing SLB instance, check whether the instance meets the following
requirements:
- The SLB instance that you want to reuse is created in the SLB console. You cannot reuse an SLB instance that is created by CCM.
- If you want to reuse an internal-facing SLB instance, the SLB instance and the cluster must be deployed in the same virtual private cloud (VPC).
- CCM configures SLB instances only for
LoadBalancer
type Services.Notice If you changeType=LoadBalancer
toType!=LoadBalancer
for a Service, CCM deletes the configuration of the SLB instance from the Service. In this case, you cannot access the Service by using the SLB instance. - When specific conditions are met, CCM uses a declarative API to automatically update
the configuration of an SLB instance based on the Service configuration. If you set
annotation
service.beta.kubernetes.io/alibaba-cloud-loadbalancer-force-override-listeners:
totrue
for a Service, CCM may overwrite the listener configuration modifications that are made in the SLB console.Notice If the SLB instance is created or managed by CCM, we recommend that you do not modify the configuration of an SLB instance in the SLB console. Otherwise, CCM may overwrite the configuration and the Service may be unavailable.
Considerations for using CCM to configure an SLB instance
- CCM configures SLB instances only for
LoadBalancer
type Services.Notice If you changeType=LoadBalancer
toType!=LoadBalancer
for a Service, CCM deletes the SLB instance that CCM previously created for the Service. - When specific conditions are met, CCM uses a declarative API to automatically update
the configuration of an SLB instance based on the Service configuration. CCM may overwrite
the listener configuration modifications that are made in the SLB console.
Notice If the SLB instance is created or managed by CCM, we recommend that you do not modify the configuration of an SLB instance in the SLB console. Otherwise, CCM may overwrite the configuration and the Service may be unavailable.
Resource quotas
- A node in a cluster is mapped to a route entry in a route table. By default, each
route table for a VPC contains a maximum of 48 entries. If the number of nodes in
a cluster exceeds 48, Submit a ticket.
Note In the ticket, describe your request to modify parameter
vpc_quota_route_entrys_num
. After the request is accepted, the maximum number of custom entries that can be created in one route table is increased. - For more information about VPC resource quotas, see Limits and quotas.
To query the VPC resource quotas, go to the Quota Management page in the VPC console.
SLB
- CCM creates an SLB instance for a
LoadBalancer
type Service. By default, you can retain a maximum of 60 SLB instances under each account. To create more SLB instances, Submit a ticket.Note In the ticket, describe your request to modify parameterslb_quota_instances_num
. After the request is accepted, the maximum number of SLB instances that can be retained under your account is increased. - CCM adds ECS instances to the VServer groups of an SLB instance based on the Service
configuration.
- By default, an ECS instance can be added to a maximum of 50 VServer groups. To add
the ECS instance to more VServer groups, Submit a ticket.
Note In the ticket, describe your request to modify parameter
slb_quota_backendservers_num
. After the request is accepted, the maximum number of VServer groups to which an ECS instance can be added is increased. - By default, a maximum of 200 backend servers can be added to an SLB instance. To add
more backend servers, submit a ticket.
Note In the ticket, describe your request to modify parameter
slb_quota_backendservers_num
. After the request is accepted, the maximum number of backend servers that can be added to an SLB instance is increased.
- By default, an ECS instance can be added to a maximum of 50 VServer groups. To add
the ECS instance to more VServer groups, Submit a ticket.
- CCM creates listeners based on the ports that are specified for a Service. By default,
a maximum of 50 listeners can be created for an SLB instance. To create more listeners,
submit a ticket.
Note In the ticket, describe your request to modify parameter
slb_quota_listeners_num
. After the request is accepted, the maximum number of listeners that can be created for an SLB instance is increased. - For more information about SLB resource quotas, see Limits.
To query the SLB resource quotas, go to the Quota Management page in the SLB console.