This is an automated email from the ASF dual-hosted git repository. traky pushed a commit to branch docs/rc3-lb-fix in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
commit 17fabd6e6e0dcf6e94ddebacc01a227168b9a716 Author: Traky Deng <[email protected]> AuthorDate: Thu Aug 7 15:08:26 2025 +0800 Update load balancing Gateway API doc (RC3 fix) --- docs/en/latest/getting-started/load-balancing.md | 65 +++++++++++++++++++++--- 1 file changed, 58 insertions(+), 7 deletions(-) diff --git a/docs/en/latest/getting-started/load-balancing.md b/docs/en/latest/getting-started/load-balancing.md index ee6d2f04..8eb6b81c 100644 --- a/docs/en/latest/getting-started/load-balancing.md +++ b/docs/en/latest/getting-started/load-balancing.md @@ -80,6 +80,8 @@ If you are using Ingress or APISIX custom resources, you can proceed without add ::: +Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing: + <Tabs groupId="k8s-api" defaultValue="gateway-api" @@ -90,14 +92,63 @@ values={[ <TabItem value="gateway-api"> -APISIX Ingress controller installed with the current helm chart version (`apisix-2.11.2`) has a bug in load balancing, which is actively being fixed. +```yaml title="lb-route.yaml" +apiVersion: v1 +kind: Service +metadata: + name: httpbin-external-domain +spec: + type: ExternalName + externalName: httpbin.org +--- +apiVersion: v1 +kind: Service +metadata: + name: mockapi7-external-domain +spec: + type: ExternalName + externalName: mock.api7.ai +--- +apiVersion: apisix.apache.org/v1alpha1 +kind: BackendTrafficPolicy +metadata: + name: passhost-node +spec: + targetRefs: + - name: httpbin-external-domain + kind: Service + group: "" + - name: mockapi7-external-domain + kind: Service + group: "" + passHost: node + scheme: https +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: lb-route +spec: + parentRefs: + - name: apisix + rules: + - matches: + - path: + type: Exact + value: /headers + backendRefs: + - name: httpbin-external-domain + port: 443 + weight: 1 + - name: mockapi7-external-domain + port: 443 + weight: 1 +``` </TabItem> <TabItem value="apisix-crd"> -Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing: - ```yaml title="lb-route.yaml" apiVersion: apisix.apache.org/v2 kind: ApisixUpstream @@ -141,16 +192,16 @@ spec: - name: mockapi7-external-domain ``` +</TabItem> + +</Tabs> + Apply the configuration to your cluster: ```shell kubectl apply -f lb-route.yaml ``` -</TabItem> - -</Tabs> - ## Verify Expose the service port to your local machine by port forwarding:
