This section uses an Nginx workload as an example to describe how to add a LoadBalancer ingress.
A load balancer can be dedicated or shared. A dedicated load balancer must be of the application type (HTTP/HTTPS) and support private networks.
How to Create |
Configuration |
---|---|
Use existing |
Only the load balancers in the same VPC as the cluster can be selected. If no load balancer is available, click Create Load Balancer to create one on the ELB console. |
Auto create |
|
If there is already an HTTPS ingress for the chosen port on the load balancer, the certificate of the new HTTPS ingress must be the same as the certificate of the existing ingress. This means that a listener has only one certificate. If two certificates, each with a different ingress, are added to the same listener of the same load balancer, only the certificate added earliest takes effect on the load balancer.
For details about security policies, see ELB User Guide.
When the listener is HTTP-compliant, only HTTP can be selected.
If it is an HTTPS listener, this parameter can be set to HTTP or HTTPS.
Configuration |
Description |
Restrictions |
---|---|---|
Idle Timeout |
Timeout for an idle client connection. 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. |
None |
Request Timeout |
Timeout for waiting for a request from a client. There are two cases:
|
None |
Response Timeout |
Timeout for waiting for a response from a backend server. After a request is forwarded to the backend server, if the backend server does not respond during the timeout duration, the load balancer will stop waiting and return HTTP 504 Gateway Timeout. |
None |
HTTP2 |
Whether to use HTTP/2 for a client to communicate with a load balancer. Request forwarding using HTTP/2 improves the access performance between your application and the load balancer. However, the load balancer still uses HTTP/1.x to forward requests to the backend server. |
This function is available only when the listener is HTTPS-compliant. |
The access path added here must exist in the backend application. Otherwise, the forwarding fails.
For example, the default access URL of the Nginx application is /usr/share/nginx/html. When adding /test to the ingress forwarding policy, ensure the access URL of your Nginx application contains /usr/share/nginx/html/test. Otherwise, error 404 will be returned.
Parameter |
Description |
---|---|
Protocol |
When the protocol of the target Service port is TCP, more protocols including HTTP are supported.
|
Port |
By default, the service port (NodePort or container port of the Service) is used for health check. You can also specify another port for health check. After the port is specified, a service port named cce-healthz will be added for the Service.
|
Check Period (s) |
Specifies the maximum interval between health checks. The value ranges from 1 to 50. |
Timeout (s) |
Specifies the maximum timeout duration for each health check. The value ranges from 1 to 50. |
Max. Retries |
Specifies the maximum number of health check retries. The value ranges from 1 to 10. |
On the ELB console, you can check the load balancer automatically created through CCE. The default name is cce-lb-<ingress.UID>. Click the load balancer name to go to the details page. On the Listeners tab page, check the listener and forwarding policy of the target ingress.
After an ingress is created, upgrade and maintain the selected load balancer on the CCE console. Do not modify the configuration on the ELB console. Otherwise, the ingress service may be abnormal.