When no Server Load Balancer (SLB) instance is available, you can use cloud controller manager (CCM) to automatically create an SLB instance for a LoadBalancer Service and then use CCM to manage the SLB instance. This topic describes how to use an automatically created SLB instance to expose an application. An NGINX application is used as an example.
Precautions
- CCM configures SLB instances only for
Type=LoadBalancer
Services. CCM does not configure SLB instances for other types of Services.Notice When a Service is changed fromType=LoadBalancer
to another type, CCM deletes the configurations that are added to the SLB instance of the Service. As a result, you can no longer use the SLB instance to access the Service. - CCM uses a declarative API. CCM automatically updates the configurations of an SLB
instance to match the configurations of the exposed Service when specific conditions
are met. If you modify the configurations of an SLB instance in the SLB console, CCM
may overwrite the changes.
Notice Do not use the SLB console to modify the configurations of the SLB instance that is created and managed by CCM. Otherwise, the modifications may be overwritten and the Service may become inaccessible.
- You cannot change the SLB instance of a LoadBalancer Service after the Service is created. To change the SLB instance, you must create a new Service.
SLB resource quotas
- CCM creates SLB instances for
Type=LoadBalancer
Services. By default, you can have a maximum of 60 SLB instances within each Alibaba Cloud account. To create more than 60 SLB instances, Submit a ticket.Note In the ticket, specify that you want to modify theslb_quota_instances_num
parameter to create more SLB instances. - CCM automatically creates SLB listeners that use Service ports. By default, each SLB
instance supports a maximum of 50 listeners. To create more than 50 listeners for
an SLB instance, submit a ticket.
Note In the ticket, specify that you want to modify the
slb_quota_listeners_num
parameter to create more listeners for each SLB instance. - CCM automatically adds Elastic Compute Service (ECS) instances to backend server groups
of an SLB instance based on the Service configurations.
- By default, an ECS instance can be added to up to 50 backend server groups. To add
an ECS instance to more than 50 server groups, Submit a ticket.
Note In the ticket, specify that you want to modify the
slb_quota_backendserver_attached_num
parameter to add an ECS instance to more server groups. - By default, you can add up to 200 backend servers to an SLB instance. To add more
backend servers to an SLB instance, submit a ticket.
Note In the ticket, specify that you want to modify the
slb_quota_backendservers_num
parameter to add more backend servers to an SLB instance.
For more information about SLB resource quotas, see Limits. To query SLB resource quotas, go to the Quota Management page in the SLB console.
- By default, an ECS instance can be added to up to 50 backend server groups. To add
an ECS instance to more than 50 server groups, Submit a ticket.
Step 1: Deploy a sample application
The following section describes how to use the kubectl command-line tool to deploy an application. For more information about how to deploy an application by using the ACK console, see Create a stateless application by using a Deployment.
Step 2: Use an automatically created SLB instance to expose an application
You can use the Container Service for Kubernetes (ACK) console or kubectl to create a LoadBalancer Service. After the Service is created, you use the Service to expose the application.
Use the ACK console
Use kubectl