Skip to content

Commit 7bcec03

Browse files
authored
Merge pull request #201183 from jahabibi/web-app-routing-update
Fix errors in web app routing docs
2 parents 9710d68 + 98d0c70 commit 7bcec03

File tree

1 file changed

+33
-24
lines changed

1 file changed

+33
-24
lines changed

articles/aks/web-app-routing.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ The Web Application Routing solution makes it easy to access applications that a
2020

2121
## Web Application Routing solution overview
2222

23-
The add-on deploys four components: an [nginx ingress controller][nginx], [Secrets Store CSI Driver][csi-driver], [Open Service Mesh (OSM)][osm], and [External-DNS][external-dns] controller.
23+
The add-on deploys two components: an [nginx ingress controller][nginx], and [External-DNS][external-dns] controller.
2424

2525
- **Nginx ingress Controller**: The ingress controller exposed to the internet.
2626
- **External-DNS controller**: Watches for Kubernetes Ingress resources and creates DNS A records in the cluster-specific DNS zone.
27-
- **CSI driver**: Connector used to communicate with keyvault to retrieve SSL certificates for ingress controller.
28-
- **OSM**: A lightweight, extensible, cloud native service mesh that allows users to uniformly manage, secure, and get out-of-the-box observability features for highly dynamic microservice environments.
2927

3028
## Prerequisites
3129

@@ -48,23 +46,31 @@ az extension update --name aks-preview
4846

4947
### Install the `osm` CLI
5048

51-
Since Web Application Routing uses OSM internally to secure intranet communication, we need to set up the `osm` CLI. This command-line tool contains everything needed to install and configure Open Service Mesh. The binary is available on the [OSM GitHub releases page][osm-release].
49+
Since Web Application Routing uses OSM internally to secure intranet communication, we need to set up the `osm` CLI. This command-line tool contains everything needed to configure and manage Open Service Mesh. The latest binaries are available on the [OSM GitHub releases page][osm-release].
5250

53-
## Deploy Web Application Routing with the Azure CLI
51+
### Import certificate to Azure Keyvault
5452

55-
The Web Application Routing routing add-on can be enabled with the Azure CLI when deploying an AKS cluster. To do so, use the [az aks create][az-aks-create] command with the `--enable-addons` argument.
53+
```bash
54+
openssl pkcs12 -export -in aks-ingress-tls.crt -inkey aks-ingress-tls.key -out aks-ingress-tls.pfx
55+
# skip Password prompt
56+
```
5657

5758
```azurecli
58-
az aks create --resource-group myResourceGroup --name myAKSCluster --enable-addons web_application_routing
59+
az keyvault certificate import --vault-name <MY_KEYVAULT> -n <KEYVAULT-CERTIFICATE-NAME> -f aks-ingress-tls.pfx
5960
```
6061

61-
> [!TIP]
62-
> If you want to enable multiple add-ons, provide them as a comma-separated list. For example, to enable Web Application Routing routing and monitoring, use the format `--enable-addons web_application_routing,monitoring`.
62+
## Deploy Web Application Routing with the Azure CLI
63+
64+
The Web Application Routing routing add-on can be enabled with the Azure CLI when deploying an AKS cluster. To do so, use the [az aks create][az-aks-create] command with the `--enable-addons` argument. However, since Web Application routing depends on the OSM addon to secure intranet communication and the Azure Keyvault Secret Provider to retrieve certificates, we must enable them at the same time.
65+
66+
```azurecli
67+
az aks create --resource-group myResourceGroup --name myAKSCluster --enable-addons azure-keyvault-secrets-provider,open-service-mesh,web_application_routing --generate-ssh-keys
68+
```
6369

6470
You can also enable Web Application Routing on an existing AKS cluster using the [az aks enable-addons][az-aks-enable-addons] command. To enable Web Application Routing on an existing cluster, add the `--addons` parameter and specify *web_application_routing* as shown in the following example:
6571

6672
```azurecli
67-
az aks enable-addons --resource-group myResourceGroup --name myAKSCluster --addons web_application_routing
73+
az aks enable-addons --resource-group myResourceGroup --name myAKSCluster --addons azure-keyvault-secrets-provider,open-service-mesh,web_application_routing
6874
```
6975

7076
## Connect to your AKS cluster
@@ -109,16 +115,10 @@ Copy the identity's object ID:
109115

110116
### Grant access to Azure Key Vault
111117

112-
Obtain the vault URI for your Azure Key Vault:
113-
114-
```azurecli
115-
az keyvault show --resource-group myResourceGroup --name myapp-contoso
116-
```
117-
118118
Grant `GET` permissions for Web Application Routing to retrieve certificates from Azure Key Vault:
119119

120120
```azurecli
121-
az keyvault set-policy --name myapp-contoso --object-id <WEB_APP_ROUTING_MSI_OBJECT_ID> --secret-permissions get --certificate-permissions get
121+
az keyvault set-policy --name myapp-contoso --object-id <WEB_APP_ROUTING_MSI_OBJECT_ID> --secret-permissions get --certificate-permissions get
122122
```
123123

124124
## Use Web Application Routing
@@ -128,12 +128,16 @@ The Web Application Routing solution may only be triggered on service resources
128128
```yaml
129129
annotations:
130130
kubernetes.azure.com/ingress-host: myapp.contoso.com
131-
kubernetes.azure.com/tls-cert-keyvault-uri: myapp-contoso.vault.azure.net/certificates/keyvault-certificate-name/keyvault-certificate-name-revision
131+
kubernetes.azure.com/tls-cert-keyvault-uri: https://<MY-KEYVAULT>.vault.azure.net/certificates/<KEYVAULT-CERTIFICATE-NAME>/<KEYVAULT-CERTIFICATE-REVISION>
132132
```
133133
134-
These annotations in the service manifest would direct Web Application Routing to create an ingress servicing `myapp.contoso.com` connected to the keyvault `myapp-contoso` and will retrieve the `keyvault-certificate-name` with `keyvault-certificate-name-revision`
134+
These annotations in the service manifest would direct Web Application Routing to create an ingress servicing `myapp.contoso.com` connected to the keyvault `<MY-KEYVAULT>` and will retrieve the `<KEYVAULT-CERTIFICATE-NAME>` with `<KEYVAULT-CERTIFICATE-REVISION>`. To obtain the certificate URI within your keyvault run:
135+
136+
```azurecli
137+
az keyvault certificate show --vault-name <MY_KEYVAULT> --name <KEYVAULT-CERTIFICATE-NAME> -o jsonc | jq .id
138+
```
135139

136-
Create a file named **samples-web-app-routing.yaml** and copy in the following YAML. On line 29-31, update `<MY_HOSTNAME>` with your DNS host name and `<MY_KEYVAULT_URI>` with the full certficicate vault URI.
140+
Create a file named **samples-web-app-routing.yaml** and copy in the following YAML. On line 29-31, update `<MY_HOSTNAME>` with your DNS host name and `<MY_KEYVAULT_CERTIFICATE_URI>` with the ID returned from keyvault.
137141

138142
```yaml
139143
apiVersion: apps/v1
@@ -165,7 +169,7 @@ metadata:
165169
name: aks-helloworld
166170
annotations:
167171
kubernetes.azure.com/ingress-host: <MY_HOSTNAME>
168-
kubernetes.azure.com/tls-cert-keyvault-uri: <MY_KEYVAULT_URI>
172+
kubernetes.azure.com/tls-cert-keyvault-uri: <MY_KEYVAULT_CERTIFICATE_URI>
169173
spec:
170174
type: ClusterIP
171175
ports:
@@ -190,10 +194,15 @@ service/aks-helloworld created
190194
## Verify the managed ingress was created
191195

192196
```bash
193-
$ kubectl get ingress -n hello-web-app-routing
197+
kubectl get ingress -n hello-web-app-routing
198+
199+
NAME CLASS HOSTS ADDRESS PORTS AGE
200+
aks-helloworld webapprouting.kubernetes.azure.com myapp.contoso.com 20.51.92.19 80, 443 4m
194201
```
195202

196-
Open a web browser to *<MY_HOSTNAME>*, for example *myapp.contoso.com* and verify you see the demo application. The application may take a few minutes to appear.
203+
## Configure external DNS to point to cluster
204+
205+
Now that Web Application Routing is configured within our cluster and we have the external IP address, we can configure our DNS servers to reflect this. As soon as the DNS updates have propagated, open a web browser to *<MY_HOSTNAME>*, for example *myapp.contoso.com* and verify you see the demo application. The application may take a few minutes to appear.
197206

198207
## Remove Web Application Routing
199208

@@ -206,7 +215,7 @@ kubectl delete namespace hello-web-app-routing
206215
The Web Application Routing add-on can be removed using the Azure CLI. To do so run the following command, substituting your AKS cluster and resource group name.
207216

208217
```azurecli
209-
az aks disable-addons --addons web_application_routing --name myAKSCluster --resource-group myResourceGroup --no-wait
218+
az aks disable-addons --addons azure-keyvault-secrets-provider,open-service-mesh,web_application_routing --name myAKSCluster --resource-group myResourceGroup
210219
```
211220

212221
When the Web Application Routing add-on is disabled, some Kubernetes resources may remain in the cluster. These resources include *configMaps* and *secrets*, and are created in the *app-routing-system* namespace. To maintain a clean cluster, you may want to remove these resources.

0 commit comments

Comments
 (0)