Skip to content

Commit fd5a14c

Browse files
committed
Markdown
1 parent e1b8b94 commit fd5a14c

7 files changed

+417
-368
lines changed

articles/application-gateway/for-containers/how-to-path-header-query-string-routing-gateway-api.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ Application Gateway for Containers enables traffic routing based on URL path, qu
2828
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)
2929
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).
3030
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.
32-
```bash
33-
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/traffic-split-scenario/deployment.yaml
34-
```
31+
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate path, query, and header based routing.
32+
33+
```bash
34+
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/traffic-split-scenario/deployment.yaml
35+
```
3536

36-
This command creates the following on your cluster:
37-
- a namespace called `test-infra`
38-
- two services called `backend-v1` and `backend-v2` in the `test-infra` namespace
39-
- two deployments called `backend-v1` and `backend-v2` in the `test-infra` namespace
37+
This command creates the following on your cluster:
38+
39+
- a namespace called `test-infra`
40+
- two services called `backend-v1` and `backend-v2` in the `test-infra` namespace
41+
- two deployments called `backend-v1` and `backend-v2` in the `test-infra` namespace
4042

4143
## Deploy the required Gateway API resources
4244

@@ -69,6 +71,7 @@ EOF
6971
[!INCLUDE [application-gateway-for-containers-frontend-naming](../../../includes/application-gateway-for-containers-frontend-naming.md)]
7072

7173
# [Bring your own (BYO) deployment](#tab/byo)
74+
7275
1. Set the following environment variables
7376

7477
```bash
@@ -80,6 +83,7 @@ FRONTEND_NAME='frontend'
8083
```
8184

8285
2. Create a Gateway
86+
8387
```bash
8488
kubectl apply -f - <<EOF
8589
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -107,11 +111,13 @@ EOF
107111
---
108112

109113
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+
110115
```bash
111116
kubectl get gateway gateway-01 -n test-infra -o yaml
112117
```
113118

114119
Example output of successful gateway creation.
120+
115121
```yaml
116122
status:
117123
addresses:
@@ -206,6 +212,7 @@ EOF
206212
```
207213

208214
Once the HTTPRoute resource has been created, ensure the route has been _Accepted_ and the Application Gateway for Containers resource has been _Programmed_.
215+
209216
```bash
210217
kubectl get httproute http-route -n test-infra -o yaml
211218
```
@@ -253,33 +260,39 @@ fqdn=$(kubectl get gateway gateway-01 -n test-infra -o jsonpath='{.status.addres
253260
By using the curl command, we can validate three different scenarios:
254261

255262
### Path based routing
263+
256264
In this scenario, the client request sent to http://frontend-fqdn/bar is routed to backend-v2 service.
257265

258266
Run the following command:
267+
259268
```bash
260269
curl http://$fqdn/bar
261270
```
262271

263272
Notice the container serving the request is backend-v2.
264273

265274
### Query string + header + path routing
275+
266276
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.
267277

268278
Run the following command:
279+
269280
```bash
270281
curl http://$fqdn/some/thing?great=example -H "magic: foo"
271282
```
272283

273284
Notice the container serving the request is backend-v2.
274285

275286
### Default route
287+
276288
If neither of the first two scenarios are satisfied, Application Gateway for Containers routes all other requests to the backend-v1 service.
277289

278290
Run the following command:
291+
279292
```bash
280293
curl http://$fqdn/
281294
```
282295

283296
Notice the container serving the request is backend-v1.
284297

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.

articles/application-gateway/for-containers/how-to-ssl-offloading-gateway-api.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ms.author: greglin
1414
# SSL offloading with Application Gateway for Containers - Gateway API
1515

1616
This document helps set up an example application that uses the following resources from Gateway API. Steps are provided to:
17+
1718
- Create a [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
1819
- Create an [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) that references a backend service.
1920

@@ -33,7 +34,7 @@ Application Gateway for Containers enables SSL [offloading](/azure/architecture/
3334
```bash
3435
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/https-scenario/ssl-termination/deployment.yaml
3536
```
36-
37+
3738
This command creates the following on your cluster:
3839
- a namespace called `test-infra`
3940
- one service called `echo` in the `test-infra` namespace
@@ -45,6 +46,7 @@ Application Gateway for Containers enables SSL [offloading](/azure/architecture/
4546
# [ALB managed deployment](#tab/alb-managed)
4647

4748
1. Create a Gateway
49+
4850
```bash
4951
kubectl apply -f - <<EOF
5052
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -88,6 +90,7 @@ FRONTEND_NAME='frontend'
8890
```
8991
9092
2. Create a Gateway
93+
9194
```bash
9295
kubectl apply -f - <<EOF
9396
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -121,11 +124,13 @@ EOF
121124
---
122125

123126
When the gateway resource is created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
127+
124128
```bash
125129
kubectl get gateway gateway-01 -n test-infra -o yaml
126130
```
127131

128132
Example output of successful gateway creation.
133+
129134
```yaml
130135
status:
131136
addresses:
@@ -171,7 +176,8 @@ status:
171176
kind: HTTPRoute
172177
```
173178
174-
Once the gateway is created, create an HTTPRoute
179+
Once the gateway is created, create an HTTPRoute resource.
180+
175181
```bash
176182
kubectl apply -f - <<EOF
177183
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -190,6 +196,7 @@ EOF
190196
```
191197

192198
Once the HTTPRoute resource is created, ensure the route is _Accepted_ and the Application Gateway for Containers resource is _Programmed_.
199+
193200
```bash
194201
kubectl get httproute https-route -n test-infra -o yaml
195202
```

articles/application-gateway/for-containers/how-to-ssl-offloading-ingress-api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOU
8787
FRONTEND_NAME='frontend'
8888
```
8989

90-
2. Create an Ingress
90+
2. Create an Ingress resource.
91+
9192
```bash
9293
kubectl apply -f - <<EOF
9394
apiVersion: networking.k8s.io/v1
@@ -121,11 +122,13 @@ EOF
121122
---
122123

123124
When the ingress resource is created, ensure the status shows the hostname of your load balancer and that both ports are listening for requests.
125+
124126
```bash
125127
kubectl get ingress ingress-01 -n test-infra -o yaml
126128
```
127129

128130
Example output of successful Ingress creation.
131+
129132
```yaml
130133
apiVersion: networking.k8s.io/v1
131134
kind: Ingress

articles/application-gateway/for-containers/how-to-traffic-splitting-gateway-api.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,13 @@ EOF
108108
---
109109

110110
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+
111112
```bash
112113
kubectl get gateway gateway-01 -n test-infra -o yaml
113114
```
114115

115116
Example output of successful gateway creation.
117+
116118
```yaml
117119
status:
118120
addresses:
@@ -159,6 +161,7 @@ status:
159161
```
160162
161163
Once the gateway has been created, create an HTTPRoute
164+
162165
```bash
163166
kubectl apply -f - <<EOF
164167
apiVersion: gateway.networking.k8s.io/v1beta1
@@ -181,6 +184,7 @@ EOF
181184
```
182185

183186
Once the HTTPRoute resource has been created, ensure the route has been _Accepted_ and the Application Gateway for Containers resource has been _Programmed_.
187+
184188
```bash
185189
kubectl get httproute traffic-split-route -n test-infra -o yaml
186190
```

0 commit comments

Comments
 (0)