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/aks/web-app-routing.md
+33-24Lines changed: 33 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,12 +20,10 @@ The Web Application Routing solution makes it easy to access applications that a
20
20
21
21
## Web Application Routing solution overview
22
22
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.
24
24
25
25
-**Nginx ingress Controller**: The ingress controller exposed to the internet.
26
26
-**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.
29
27
30
28
## Prerequisites
31
29
@@ -48,23 +46,31 @@ az extension update --name aks-preview
48
46
49
47
### Install the `osm` CLI
50
48
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].
52
50
53
-
##Deploy Web Application Routing with the Azure CLI
51
+
### Import certificate to Azure Keyvault
54
52
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.
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
59
60
```
60
61
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
+
```
63
69
64
70
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:
65
71
66
72
```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
68
74
```
69
75
70
76
## Connect to your AKS cluster
@@ -109,16 +115,10 @@ Copy the identity's object ID:
109
115
110
116
### Grant access to Azure Key Vault
111
117
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
-
118
118
Grant `GET` permissions for Web Application Routing to retrieve certificates from Azure Key Vault:
119
119
120
120
```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
122
122
```
123
123
124
124
## Use Web Application Routing
@@ -128,12 +128,16 @@ The Web Application Routing solution may only be triggered on service resources
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
+
```
135
139
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.
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.
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.
207
216
208
217
```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
210
219
```
211
220
212
221
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