All Products
Search
Document Center

Enterprise Distributed Application Service:UpdateK8sSlb

Last Updated:Jan 08, 2024

Updates the Server Load Balancer (SLB) instance bound 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:ManageApplicationWrite
  • Application
    acs:edas:{#regionId}:{#accountId}:namespace/{#NameSpaceId}/application/{#AppId}
    none
none

Request syntax

PUT /pop/v5/k8s/acs/k8s_slb_binding

Request parameters

ParameterTypeRequiredDescriptionExample
AppIdstringYes

The ID of the application. You can query the application ID by calling the ListApplication operation. For more information, see ListApplication .

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

The ID of the cluster. You can query the cluster ID by calling the GetK8sCluster operation. For more information, see GetK8sCluster .

712082c3-****-****-9217-a947b5cde6ee
TypestringYes

The type of the SLB instance. Valid values:

  • Internet: an Internet-facing SLB instance
  • Intranet: an internal-facing SLB instance
Internet
SlbProtocolstringNo

The protocol used by the SLB instance. Set the value to TCP.

TCP
TargetPortstringNo

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

8082
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: required. The frontend port. Valid values: 1 to 65535. Each port must be unique.
  • targetPort: required. The backend port. Valid values: 1 to 65535.
  • loadBalancerProtocol: 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 specify the AppId, ClusterId, Type, and SlbId parameters.
{"targetPort":8080,"port":82,"loadBalancerProtocol":"TCP"},{"port":81,"certId":"136246975637380916c185d6fa21914500329_-xxxxxxx","targetPort":8181,"lo adBalancerProtocol":"HTTPS"}
SpecificationstringNo

The specifications of the SLB instance.

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

If you do not specify this parameter, the default value slb.s1.small is used.

slb.s1.small
SchedulerstringNo

The scheduling algorithm for the SLB instance. If you do not specify this parameter, the default value rr is used. SLB supports the following scheduling algorithms: round-robin and weighted round-robin. 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
SlbNamestringNo

The name of the SLB instance.

SLB_doctest
DisableForceOverridebooleanNo

Specifies whether to disable listener configuration overriding.

  • true: disables listener configuration overriding.
  • false: enables listener configuration overriding.
true

Response parameters

ParameterTypeDescriptionExample
object
ChangeOrderIdstring

The ID of the change process.

9a1dcdee-****-****-ad37-cbf9dc91fba9
Codeinteger

The HTTP status code that is returned.

200
Messagestring

The message that is returned.

success
RequestIdstring

The ID of the request.

4823-bhjf-23u4-eiufh

Examples

Sample success responses

JSONformat

{
  "ChangeOrderId": "9a1dcdee-****-****-ad37-cbf9dc91fba9",
  "Code": 200,
  "Message": "success",
  "RequestId": "4823-bhjf-23u4-eiufh"
}

Error codes

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