Configuring Timeout for a LoadBalancer Service
LoadBalancer Services allow you to configure timeout, which is the maximum duration for keeping a connection if no request is received from the client. If no request is received during this period, the load balancer closes the connection and establishes a new one with the client when the next request arrives.
After timeout is configured, if you delete the timeout configuration on the CCE console or delete the target annotation from the YAML file, the configuration on the ELB will be retained.
Notes and Constraints
Timeout Type |
Load Balancer Type |
Restrictions |
Supported Cluster Version |
---|---|---|---|
Idle timeout |
Dedicated |
None |
|
Using kubectl
apiVersion: v1 kind: Service metadata: annotations: kubernetes.io/elb.id: <your_elb_id> # In this example, an existing dedicated load balancer is used. Replace its ID with the ID of your dedicated load balancer. kubernetes.io/elb.class: performance # Load balancer type kubernetes.io/elb.protocol-port: http:80 # The HTTP port 80 is used. kubernetes.io/elb.keepalive_timeout: '300' # Timeout setting for client connections name: nginx spec: ports: - name: service0 port: 80 protocol: TCP targetPort: 80 selector: app: nginx type: LoadBalancer
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
kubernetes.io/elb.keepalive_timeout |
No |
String |
Timeout for client connections. If there are no requests reaching the load balancer during the timeout duration, the load balancer will disconnect the connection from the client and establish a new connection when there is a new request. Value:
|
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.