- Documentation
Volcengine Kubernetes Engine
Volcengine Kubernetes Engine
User guide
Networking
Ingress
ALB Ingress
Customize ALB Ingress forwarding rules
Configuring traffic forwarding based on request methods
Customize ALB Ingress forwarding rules
Configuring traffic forwarding based on request methods
Configuring traffic forwarding based on request methods
An ALB Ingress that uses a standard ALB instance supports configuring header-based traffic distribution policies and determining the back-end Service to forward traffic to based on different HTTP request methods.
- The alb-ingress-controller add-on has been installed and upgraded to v0.36.0 or later. For details, see Upgrading add-ons.
Configure through the console
- In the left navigation bar, click Cluster.
- On the cluster list page, click the target cluster for which you need to configure an Ingress.
- In the left navigation bar of the cluster management page, click Services and Ingresses > Ingress. On the page that appears, click Create Ingress.
- Select Application Load Balancer (ALB) for Ingress type.
- In the Forwarding rules settings, select the Enable check box to configure custom forwarding rules.
An ALB Ingress allows you to configure request header-based forwarding policies by using annotations. The following is an example YAML with comments for annotations.
- The {{service-name}} field in the annotation must match the name of the back-end service configured in spec.rules. For example, in this case, the correct annotation is ingress.vke.volcengine.com/loadbalancer-conditions.service-demo.
- The Method configuration in the annotations section and the host configuration in spec.rules will be combined. For example, in this case, requests with example.com as the host and request method GET or POST will all be forwarded to the service-demo service.
The following table describes fields in the ingress.vke.volcengine.com/loadbalancer-conditions.{{service-name}} annotation.
- Click Instance in the left navigation bar. In the instance list, find the target ALB instance and click Listener in the Actions column.
- On the listener details page, find the target listener. In the Actions column, click Edit forwarding rules to view the existing forwarding rules of the listener. Confirm that the request methods are consistent with the configured ones.
Sending access requests for verification
tip
Before verification, make sure that you have deployed back-end applications and services in the cluster. In this example, an Nginx image is used and the service path is /. For deployment steps, see Using ALB Ingresses for service deployment. - Access the service by using the domain name configured in the ALB Ingress. In this example, 14.***.***.*** is the public IP address of the ALB instance.
Since an HTTP method that is not allowed was used during access, the back-end service cannot be accessed correctly.
- Run the following command again to access the service using an allowed HTTP request method.
Since an allowed HTTP request method was used, the back-end service can be accessed correctly.
Last updated: 2026.07.24 14:51:39