@@ -80,6 +80,8 @@ If you are using Ingress or APISIX custom resources, you can proceed without add
80
80
81
81
:::
82
82
83
+ Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing:
84
+
83
85
<Tabs
84
86
groupId="k8s-api"
85
87
defaultValue="gateway-api"
@@ -90,14 +92,63 @@ values={[
90
92
91
93
<TabItem value="gateway-api">
92
94
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
+ ` ` `
94
147
95
148
</TabItem>
96
149
97
150
<TabItem value="apisix-crd">
98
151
99
- Create a Kubernetes manifest file for a route that proxy requests to two upstream services for load balancing :
100
-
101
152
` ` ` yaml title="lb-route.yaml"
102
153
apiVersion : apisix.apache.org/v2
103
154
kind : ApisixUpstream
@@ -141,16 +192,16 @@ spec:
141
192
- name : mockapi7-external-domain
142
193
` ` `
143
194
195
+ </TabItem>
196
+
197
+ </Tabs>
198
+
144
199
Apply the configuration to your cluster:
145
200
146
201
` ` ` shell
147
202
kubectl apply -f lb-route.yaml
148
203
```
149
204
150
- </TabItem>
151
-
152
- </Tabs>
153
-
154
205
## Verify
155
206
156
207
Expose the service port to your local machine by port forwarding:
0 commit comments