Skip to content

Commit 327a4d1

Browse files
committed
Markdown and v1
1 parent 870f62c commit 327a4d1

8 files changed

+199
-179
lines changed

articles/application-gateway/for-containers/how-to-backend-mtls-gateway-api.md

Lines changed: 38 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.author: greglin
1515
This document helps set up an example application that uses the following resources from Gateway API. Steps are provided to:
1616

1717
- Create a [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTPS listener.
18-
- Create an [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) resource that references a backend service.
18+
- Create an [HTTPRoute](https://gateway-api.sigs.k8s.io/api-types/httproute/) resource that references a backend service.
1919
- Create a [BackendTLSPolicy](api-specification-kubernetes.md#alb.networking.azure.io/v1.BackendTLSPolicy) resource that has a client and CA certificate for the backend service referenced in the HTTPRoute.
2020

2121
## Background
@@ -86,45 +86,46 @@ EOF
8686

8787
1. Set the following environment variables
8888

89-
```bash
90-
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
91-
RESOURCE_NAME='alb-test'
89+
```bash
90+
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
91+
RESOURCE_NAME='alb-test'
9292

93-
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
94-
FRONTEND_NAME='frontend'
95-
az network alb frontend create -g $RESOURCE_GROUP -n $FRONTEND_NAME --alb-name $AGFC_NAME
96-
```
93+
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
94+
FRONTEND_NAME='frontend'
95+
az network alb frontend create -g $RESOURCE_GROUP -n $FRONTEND_NAME --alb-name $AGFC_NAME
96+
```
9797

9898
2. Create a Gateway
99-
```bash
100-
kubectl apply -f - <<EOF
101-
apiVersion: gateway.networking.k8s.io/v1
102-
kind: Gateway
103-
metadata:
104-
name: gateway-01
105-
namespace: test-infra
106-
annotations:
107-
alb.networking.azure.io/alb-id: $RESOURCE_ID
108-
spec:
109-
gatewayClassName: azure-alb-external
110-
listeners:
111-
- name: https-listener
112-
port: 443
113-
protocol: HTTPS
114-
allowedRoutes:
115-
namespaces:
116-
from: Same
117-
tls:
118-
mode: Terminate
119-
certificateRefs:
120-
- kind : Secret
121-
group: ""
122-
name: frontend.com
123-
addresses:
124-
- type: alb.networking.azure.io/alb-frontend
125-
value: $FRONTEND_NAME
126-
EOF
127-
```
99+
100+
```bash
101+
kubectl apply -f - <<EOF
102+
apiVersion: gateway.networking.k8s.io/v1
103+
kind: Gateway
104+
metadata:
105+
name: gateway-01
106+
namespace: test-infra
107+
annotations:
108+
alb.networking.azure.io/alb-id: $RESOURCE_ID
109+
spec:
110+
gatewayClassName: azure-alb-external
111+
listeners:
112+
- name: https-listener
113+
port: 443
114+
protocol: HTTPS
115+
allowedRoutes:
116+
namespaces:
117+
from: Same
118+
tls:
119+
mode: Terminate
120+
certificateRefs:
121+
- kind : Secret
122+
group: ""
123+
name: frontend.com
124+
addresses:
125+
- type: alb.networking.azure.io/alb-frontend
126+
value: $FRONTEND_NAME
127+
EOF
128+
```
128129
129130
---
130131

articles/application-gateway/for-containers/how-to-header-rewrite-gateway-api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Application Gateway for Containers allows you to rewrite HTTP headers of client
1616

1717
## Usage details
1818

19-
Header rewrites take advantage of [filters](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1beta1.HTTPURLRewriteFilter) as defined by Kubernetes Gateway API.
19+
Header rewrites take advantage of [filters](https://gateway-api.sigs.k8s.io/references/spec/#gateway.networking.k8s.io/v1.HTTPURLRewriteFilter) as defined by Kubernetes Gateway API.
2020

2121
## Background
2222

@@ -51,7 +51,7 @@ Create a gateway:
5151

5252
```bash
5353
kubectl apply -f - <<EOF
54-
apiVersion: gateway.networking.k8s.io/v1beta1
54+
apiVersion: gateway.networking.k8s.io/v1
5555
kind: Gateway
5656
metadata:
5757
name: gateway-01
@@ -89,7 +89,7 @@ FRONTEND_NAME='frontend'
8989

9090
```bash
9191
kubectl apply -f - <<EOF
92-
apiVersion: gateway.networking.k8s.io/v1beta1
92+
apiVersion: gateway.networking.k8s.io/v1
9393
kind: Gateway
9494
metadata:
9595
name: gateway-01
@@ -177,7 +177,7 @@ This example also demonstrates addition of a new header called `AGC-Header-Add`
177177

178178
```bash
179179
kubectl apply -f - <<EOF
180-
apiVersion: gateway.networking.k8s.io/v1beta1
180+
apiVersion: gateway.networking.k8s.io/v1
181181
kind: HTTPRoute
182182
metadata:
183183
name: header-rewrite-route

articles/application-gateway/for-containers/how-to-multiple-site-hosting-gateway-api.md

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ms.author: greglin
1313
# Multiple site hosting with Application Gateway for Containers - Gateway API
1414

1515
This document helps you set up an example application that uses the resources from Gateway API to demonstrate hosting multiple sites on the same Kubernetes Gateway resource / Application Gateway for Containers frontend. Steps are provided to:
16+
1617
- Create a [Gateway](https://gateway-api.sigs.k8s.io/concepts/api-overview/#gateway) resource with one HTTP listener.
1718
- Create two [HTTPRoute](https://gateway-api.sigs.k8s.io/v1alpha2/api-types/httproute/) resources that each reference a unique backend service.
1819

@@ -27,24 +28,27 @@ Application Gateway for Containers enables multi-site hosting by allowing you to
2728
1. If you follow the BYO deployment strategy, ensure you set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md)
2829
2. If you follow the ALB managed deployment strategy, ensure provisioning of your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md) and the Application Gateway for Containers resources via the [ApplicationLoadBalancer custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
2930
3. Deploy sample HTTP application
30-
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate path, query, and header based routing.
31-
```bash
32-
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/traffic-split-scenario/deployment.yaml
33-
```
34-
35-
This command creates the following on your cluster:
36-
- a namespace called `test-infra`
37-
- two services called `backend-v1` and `backend-v2` in the `test-infra` namespace
38-
- two deployments called `backend-v1` and `backend-v2` in the `test-infra` namespace
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+
```
36+
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
3942

4043
## Deploy the required Gateway API resources
4144

4245
# [ALB managed deployment](#tab/alb-managed)
4346

4447
1. Create a Gateway
48+
4549
```bash
4650
kubectl apply -f - <<EOF
47-
apiVersion: gateway.networking.k8s.io/v1beta1
51+
apiVersion: gateway.networking.k8s.io/v1
4852
kind: Gateway
4953
metadata:
5054
name: gateway-01
@@ -70,47 +74,50 @@ EOF
7074

7175
1. Set the following environment variables
7276

73-
```bash
74-
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
75-
RESOURCE_NAME='alb-test'
77+
```bash
78+
RESOURCE_GROUP='<resource group name of the Application Gateway For Containers resource>'
79+
RESOURCE_NAME='alb-test'
7680

77-
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
78-
FRONTEND_NAME='frontend'
79-
```
81+
RESOURCE_ID=$(az network alb show --resource-group $RESOURCE_GROUP --name $RESOURCE_NAME --query id -o tsv)
82+
FRONTEND_NAME='frontend'
83+
```
8084

8185
2. Create a Gateway
82-
```bash
83-
kubectl apply -f - <<EOF
84-
apiVersion: gateway.networking.k8s.io/v1beta1
85-
kind: Gateway
86-
metadata:
87-
name: gateway-01
88-
namespace: test-infra
89-
annotations:
90-
alb.networking.azure.io/alb-id: $RESOURCE_ID
91-
spec:
92-
gatewayClassName: azure-alb-external
93-
listeners:
94-
- name: http-listener
95-
port: 80
96-
protocol: HTTP
97-
allowedRoutes:
98-
namespaces:
99-
from: Same
100-
addresses:
101-
- type: alb.networking.azure.io/alb-frontend
102-
value: $FRONTEND_NAME
103-
EOF
104-
```
86+
87+
```bash
88+
kubectl apply -f - <<EOF
89+
apiVersion: gateway.networking.k8s.io/v1
90+
kind: Gateway
91+
metadata:
92+
name: gateway-01
93+
namespace: test-infra
94+
annotations:
95+
alb.networking.azure.io/alb-id: $RESOURCE_ID
96+
spec:
97+
gatewayClassName: azure-alb-external
98+
listeners:
99+
- name: http-listener
100+
port: 80
101+
protocol: HTTP
102+
allowedRoutes:
103+
namespaces:
104+
from: Same
105+
addresses:
106+
- type: alb.networking.azure.io/alb-frontend
107+
value: $FRONTEND_NAME
108+
EOF
109+
```
105110
106111
---
107112
108113
Once the gateway resource is created, ensure the status is valid, the listener is _Programmed_, and an address is assigned to the gateway.
114+
109115
```bash
110116
kubectl get gateway gateway-01 -n test-infra -o yaml
111117
```
112118
113119
Example output of successful gateway creation.
120+
114121
```yaml
115122
status:
116123
addresses:
@@ -157,9 +164,10 @@ status:
157164
```
158165
159166
Once the gateway is created, create two HTTPRoute resources for `contoso.com` and `fabrikam.com` domain names. Each domain forwards traffic to a different backend service.
167+
160168
```bash
161169
kubectl apply -f - <<EOF
162-
apiVersion: gateway.networking.k8s.io/v1beta1
170+
apiVersion: gateway.networking.k8s.io/v1
163171
kind: HTTPRoute
164172
metadata:
165173
name: contoso-route
@@ -174,7 +182,7 @@ spec:
174182
- name: backend-v1
175183
port: 8080
176184
---
177-
apiVersion: gateway.networking.k8s.io/v1beta1
185+
apiVersion: gateway.networking.k8s.io/v1
178186
kind: HTTPRoute
179187
metadata:
180188
name: fabrikam-route

articles/application-gateway/for-containers/how-to-multiple-site-hosting-ingress-api.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ ms.author: greglin
1313
# Multi-site hosting with Application Gateway for Containers - Ingress API
1414

1515
This document helps you set up an example application that uses the Ingress API to demonstrate hosting multiple sites on the same Kubernetes Ingress resource / Application Gateway for Containers frontend. Steps are provided to:
16+
1617
- Create an [Ingress](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#ingressrule-v1-networking-k8s-io) resource with two hosts.
1718

1819
## Background
@@ -26,21 +27,24 @@ Application Gateway for Containers enables multi-site hosting by allowing you to
2627
1. If you follow the BYO deployment strategy, ensure that you set up your Application Gateway for Containers resources and [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md)
2728
2. If you follow the ALB managed deployment strategy, ensure provisioning of your [ALB Controller](quickstart-deploy-application-gateway-for-containers-alb-controller.md) and the Application Gateway for Containers resources via the [ApplicationLoadBalancer custom resource](quickstart-create-application-gateway-for-containers-managed-by-alb-controller.md).
2829
3. Deploy sample HTTP application
29-
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate path, query, and header based routing.
30-
```bash
31-
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/traffic-split-scenario/deployment.yaml
32-
```
30+
Apply the following deployment.yaml file on your cluster to create a sample web application to demonstrate path, query, and header based routing.
31+
32+
```bash
33+
kubectl apply -f https://trafficcontrollerdocs.blob.core.windows.net/examples/traffic-split-scenario/deployment.yaml
34+
```
3335

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

3942
## Deploy the required Ingress resource
4043

4144
# [ALB managed deployment](#tab/alb-managed)
4245

4346
1. Create an Ingress
47+
4448
```bash
4549
kubectl apply -f - <<EOF
4650
apiVersion: networking.k8s.io/v1
@@ -77,7 +81,6 @@ spec:
7781
EOF
7882
```
7983

80-
8184
# [Bring your own (BYO) deployment](#tab/byo)
8285

8386
1. Set the following environment variables
@@ -91,6 +94,7 @@ FRONTEND_NAME='frontend'
9194
```
9295

9396
2. Create an Ingress
97+
9498
```bash
9599
kubectl apply -f - <<EOF
96100
apiVersion: networking.k8s.io/v1
@@ -130,11 +134,13 @@ EOF
130134
---
131135

132136
Once the ingress resource is created, ensure the status shows the hostname of your load balancer and that both ports are listening for requests.
137+
133138
```bash
134139
kubectl get ingress ingress-01 -n test-infra -o yaml
135140
```
136141

137142
Example output of successful Ingress creation.
143+
138144
```yaml
139145
apiVersion: networking.k8s.io/v1
140146
kind: Ingress
@@ -199,6 +205,7 @@ curl -k --resolve contoso.com:80:$fqdnIp http://contoso.com
199205
```
200206

201207
Via the response we should see:
208+
202209
```json
203210
{
204211
"path": "/",
@@ -237,6 +244,7 @@ curl -k --resolve fabrikam.com:80:$fqdnIp http://fabrikam.com
237244
```
238245

239246
Via the response we should see:
247+
240248
```json
241249
{
242250
"path": "/",

0 commit comments

Comments
 (0)