All Products
Search
Document Center

Enterprise Distributed Application Service:BindK8sSlb

Last Updated:Jan 08, 2024

Binds a Server Load Balancer (SLB) instance to an application that is deployed in a Container Service for Kubernetes (ACK) cluster.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Debug

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
edas:ManageApplicationRead
  • Application
    acs:edas:{#regionId}:{#accountId}:namespace/{#NameSpaceId}/application/{#AppId}
    none
none

Request syntax

POST /pop/v5/k8s/acs/k8s_slb_binding

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

The ID of the application.

5a166fbd-****-****-a286-781659d9f54c
ClusterIdstringYes

The ID of the cluster.

712082c3-f554-****-****-a947b5cde6ee
TypestringYes

The type of the SLB instance. Valid values:

  • internet: Internet-facing SLB instance
  • intranet: internal-facing SLB instance
internet
SlbIdstringNo

The ID of the SLB instance. If you leave this parameter empty, Enterprise Distributed Application Service (EDAS) automatically purchases an SLB instance.

lb-2ze1quax9t****iz82bjt
SlbProtocolstringNo

The protocol used by the SLB instance. Valid values: TCP, HTTP, and HTTPS.

TCP
TargetPortstringNo

The backend port, which is also the service port of the application. Valid values: 1 to 65535.

8080
PortstringNo

The frontend port. Valid values: 1 to 65535.

80
ServicePortInfosstringNo

The information about the ports. This parameter is required if you want to configure multi-port mappings or use a protocol other than TCP. You must set this parameter to a JSON array. Example: [{"targetPort":8080,"port":82,"loadBalancerProtocol":"TCP"},{"port":81,"certId":"1362469756373809_16c185d6fa2_1914500329_-xxxxxxx","targetPort":8181,"lo adBalancerProtocol":"HTTPS"}]

  • port: The frontend port. Valid values: 1 to 65535. This parameter is required. Each port must be unique.
  • targetPort: The backend port. Valid values: 1 to 65535. This parameter is required.
  • loadBalancerProtocol: This parameter is required. Valid values: TCP and HTTPS. If the HTTP protocol is used, set this parameter to TCP.
  • certId: the ID of the certificate. This parameter is required if the HTTPS protocol is used. You can purchase an SLB instance in the SLB console.
Note The ServicePortInfos parameter is specified to support multi-port mappings. If you want this parameter to take effect, make sure that you have set the AppId, ClusterId, Type, and SlbId parameters.
[{"targetPort":8080,"port":82,"loadBalancerProtocol":"TCP"},{"port":81,"certId":"136246975637380916c185d6fa21914500329_-988as","targetPort":8181,"lo adBalancerProtocol":"HTTPS"}]
SpecificationstringNo

The instance type of the SLB instance. Valid values:

  • slb.s1.small
  • slb.s2.small
  • slb.s2.medium
  • slb.s3.small
  • slb.s3.medium
  • slb.s3.large
slb.s1.small
SchedulerstringNo

The scheduling algorithm for the SLB instance. If you do not specify this parameter, the default value rr is used. Valid values:

  • wrr: weighted round-robin scheduling. Backend servers that have higher weights receive more requests than those that have lower weights.
  • rr: round-robin scheduling. Requests are sequentially distributed to backend servers.
wrr

Response parameters

ParameterTypeDescriptionExample
object
ChangeOrderIdstring

The ID of the change process.

b4b37bde-a125-****-****-741f7f4a9ae3
Codeinteger

The HTTP status code that is returned.

200
Messagestring

The additional information that is returned.

success
RequestIdstring

The ID of the request.

4823-bhjf-23u4-****

Examples

Sample success responses

JSONformat

{
  "ChangeOrderId": "b4b37bde-a125-****-****-741f7f4a9ae3",
  "Code": 200,
  "Message": "success",
  "RequestId": "4823-bhjf-23u4-****"
}

Error codes

For a list of error codes, visit the Service error codes.