You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/application-gateway/for-containers/how-to-path-header-query-string-routing-gateway-api.md
+22-9Lines changed: 22 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,15 +28,17 @@ Application Gateway for Containers enables traffic routing based on URL path, qu
28
28
1. If following the BYO deployment strategy, ensure you have set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md)
29
29
2. If following the ALB managed deployment strategy, ensure you have provisioned your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md) and provisioned the Application Gateway for Containers resources via the [ApplicationLoadBalancer custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
30
30
3. Deploy sample HTTP application
31
-
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate path, query, and header based routing.
Once the gateway resource has been created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
114
+
110
115
```bash
111
116
kubectl get gateway gateway-01 -n test-infra -o yaml
112
117
```
113
118
114
119
Example output of successful gateway creation.
120
+
115
121
```yaml
116
122
status:
117
123
addresses:
@@ -206,6 +212,7 @@ EOF
206
212
```
207
213
208
214
Once the HTTPRoute resource has been created, ensure the route has been _Accepted_ and the Application Gateway for Containers resource has been _Programmed_.
215
+
209
216
```bash
210
217
kubectl get httproute http-route -n test-infra -o yaml
By using the curl command, we can validate three different scenarios:
254
261
255
262
### Path based routing
263
+
256
264
In this scenario, the client request sent to http://frontend-fqdn/bar is routed to backend-v2 service.
257
265
258
266
Run the following command:
267
+
259
268
```bash
260
269
curl http://$fqdn/bar
261
270
```
262
271
263
272
Notice the container serving the request is backend-v2.
264
273
265
274
### Query string + header + path routing
275
+
266
276
In this scenario, the client request sent to http://frontend-fqdn/some/thing?great=example with a header key/value part of "magic: foo" is routed to backend-v2 service.
Notice the container serving the request is backend-v2.
274
285
275
286
### Default route
287
+
276
288
If neither of the first two scenarios are satisfied, Application Gateway for Containers routes all other requests to the backend-v1 service.
277
289
278
290
Run the following command:
291
+
279
292
```bash
280
293
curl http://$fqdn/
281
294
```
282
295
283
296
Notice the container serving the request is backend-v1.
284
297
285
-
Congratulations, you have installed ALB Controller, deployed a backend application and routed traffic to the application via Gateway API on Application Gateway for Containers.
298
+
Congratulations, you have installed ALB Controller, deployed a backend application and routed traffic to the application via Gateway API on Application Gateway for Containers.
Copy file name to clipboardExpand all lines: articles/application-gateway/for-containers/how-to-traffic-splitting-gateway-api.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -108,11 +108,13 @@ EOF
108
108
---
109
109
110
110
Once the gateway resource has been created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
111
+
111
112
```bash
112
113
kubectl get gateway gateway-01 -n test-infra -o yaml
113
114
```
114
115
115
116
Example output of successful gateway creation.
117
+
116
118
```yaml
117
119
status:
118
120
addresses:
@@ -159,6 +161,7 @@ status:
159
161
```
160
162
161
163
Once the gateway has been created, create an HTTPRoute
164
+
162
165
```bash
163
166
kubectl apply -f - <<EOF
164
167
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -181,6 +184,7 @@ EOF
181
184
```
182
185
183
186
Once the HTTPRoute resource has been created, ensure the route has been _Accepted_ and the Application Gateway for Containers resource has been _Programmed_.
187
+
184
188
```bash
185
189
kubectl get httproute traffic-split-route -n test-infra -o yaml
0 commit comments