Skip to content

Commit 77b8210

Browse files
authored
docs: update load balancing Gateway API doc for RC3 fix (#2506)
1 parent 7a435c9 commit 77b8210

File tree

1 file changed

+58
-7
lines changed

1 file changed

+58
-7
lines changed

docs/en/latest/getting-started/load-balancing.md

Lines changed: 58 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,8 @@ If you are using Ingress or APISIX custom resources, you can proceed without add
8080
8181
:::
8282
83+
Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing:
84+
8385
<Tabs
8486
groupId="k8s-api"
8587
defaultValue="gateway-api"
@@ -90,14 +92,63 @@ values={[
9092
9193
<TabItem value="gateway-api">
9294
93-
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.
95+
```yaml title="lb-route.yaml"
96+
apiVersion: v1
97+
kind: Service
98+
metadata:
99+
name: httpbin-external-domain
100+
spec:
101+
type: ExternalName
102+
externalName: httpbin.org
103+
---
104+
apiVersion: v1
105+
kind: Service
106+
metadata:
107+
name: mockapi7-external-domain
108+
spec:
109+
type: ExternalName
110+
externalName: mock.api7.ai
111+
---
112+
apiVersion: apisix.apache.org/v1alpha1
113+
kind: BackendTrafficPolicy
114+
metadata:
115+
name: passhost-node
116+
spec:
117+
targetRefs:
118+
- name: httpbin-external-domain
119+
kind: Service
120+
group: ""
121+
- name: mockapi7-external-domain
122+
kind: Service
123+
group: ""
124+
passHost: node
125+
scheme: https
126+
---
127+
apiVersion: gateway.networking.k8s.io/v1
128+
kind: HTTPRoute
129+
metadata:
130+
name: lb-route
131+
spec:
132+
parentRefs:
133+
- name: apisix
134+
rules:
135+
- matches:
136+
- path:
137+
type: Exact
138+
value: /headers
139+
backendRefs:
140+
- name: httpbin-external-domain
141+
port: 443
142+
weight: 1
143+
- name: mockapi7-external-domain
144+
port: 443
145+
weight: 1
146+
```
94147
95148
</TabItem>
96149
97150
<TabItem value="apisix-crd">
98151
99-
Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing:
100-
101152
```yaml title="lb-route.yaml"
102153
apiVersion: apisix.apache.org/v2
103154
kind: ApisixUpstream
@@ -141,16 +192,16 @@ spec:
141192
- name: mockapi7-external-domain
142193
```
143194
195+
</TabItem>
196+
197+
</Tabs>
198+
144199
Apply the configuration to your cluster:
145200
146201
```shell
147202
kubectl apply -f lb-route.yaml
148203
```
149204

150-
</TabItem>
151-
152-
</Tabs>
153-
154205
## Verify
155206

156207
Expose the service port to your local machine by port forwarding:

0 commit comments

Comments
 (0)