Skip to content

Commit ee88920

Browse files
authored
Merge pull request #248878 from Nickomang/aks-war-migration
Application routing migration
2 parents 925d255 + d71e586 commit ee88920

File tree

3 files changed

+139
-7
lines changed

3 files changed

+139
-7
lines changed

articles/aks/TOC.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -501,24 +501,26 @@
501501
items:
502502
- name: Create a controller in AKS using Terraform
503503
href: create-k8s-cluster-with-aks-application-gateway-ingress.md
504-
- name: Use ingress-nginx
505-
items:
506-
- name: Create an ingress controller
507-
href: ingress-basic.md
508-
- name: Use TLS with an ingress controller
509-
href: ingress-tls.md
510504
- name: Use application routing add-on
511505
items:
512506
- name: Application routing add-on overview
513507
href: app-routing.md
514508
- name: Monitor using Prometheus and Grafana
515509
href: app-routing-nginx-prometheus.md
510+
- name: Migrate from HTTP application routing to the application routing add-on
511+
href: app-routing-migration.md
516512
- name: Use Application Gateway Ingress Controller add-on
517513
href: ../application-gateway/tutorial-ingress-controller-add-on-existing.md?toc=/azure/aks/toc.json&bc=/azure/aks/breadcrumb/toc.json
518514
- name: Use Istio gateway with Istio Service Mesh add-on
519515
href: istio-deploy-ingress.md
520516
- name: Use HTTP application routing add-on (retired)
521517
href: http-application-routing.md
518+
- name: Use unmanaged ingress-nginx
519+
items:
520+
- name: Create an ingress controller
521+
href: ingress-basic.md
522+
- name: Use TLS with an ingress controller
523+
href: ingress-tls.md
522524
- name: Load balancing
523525
items:
524526
- name: Create an internal load balancer

articles/aks/app-routing-migration.md

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
---
2+
title: Migrate from HTTP application routing to the application routing add-on
3+
description: Learn how to migrate from the HTTP application routing feature to the application routing add-on.
4+
ms.topic: how-to
5+
ms.author: nickoman
6+
author: nickomang
7+
ms.custom: devx-track-azurecli, devx-track-linux
8+
ms.date: 08/18/2023
9+
---
10+
11+
# Migrate from HTTP application routing to the application routing add-on
12+
13+
In this article, you'll learn how to migrate your Azure Kubernetes Service (AKS) cluster from HTTP application routing feature to the [application routing add-on](./app-routing.md). The HTTP application routing add-on has been retired and won't work on any cluster Kubernetes version currently in support, so we recommend migrating as soon as possible to maintain a supported configuration.
14+
15+
## Prerequisites
16+
17+
Azure CLI version `2.49.0` or later. If you haven't yet, follow the instructions to [Install Azure CLI][install-azure-cli]. Run `az --version` to find the version, and run `az upgrade` to upgrade the version if not already on the latest.
18+
19+
> [!NOTE]
20+
> These steps detail migrating from an unsupported configuration. As such, AKS cannot offer support for issues that arise during the migration process.
21+
22+
## Update your cluster's add-ons, ingresses, and IP usage
23+
24+
1. Enable the application routing add-on.
25+
26+
```azurecli-interactive
27+
az aks enable-addons -g <ResourceGroupName> -n <ClusterName> --addons web_application_routing
28+
```
29+
30+
2. Update your ingresses, setting `ingressClassName` to `webapprouting.kubernetes.azure.com`. Remove the `kubernetes.io/ingress.class` annotation. You'll also need to update the host to one that you own, as the application routing add-on doesn't have a managed cluster DNS zone. If you don't have a DNS zone, follow instructions to [create][app-routing-dns-create] and [configure][app-routing-dns-configure] one.
31+
32+
Initially, your ingress configuration will look something like this:
33+
34+
```yaml
35+
apiVersion: networking.k8s.io/v1
36+
kind: Ingress
37+
metadata:
38+
name: aks-helloworld
39+
annotations:
40+
kubernetes.io/ingress.class: addon-http-application-routing # Remove the ingress class annotation
41+
spec:
42+
rules:
43+
- host: aks-helloworld.<CLUSTER_SPECIFIC_DNS_ZONE>
44+
http:
45+
paths:
46+
- path: /
47+
pathType: Prefix
48+
backend:
49+
service:
50+
name: aks-helloworld
51+
port:
52+
number: 80
53+
```
54+
55+
After you've properly updated, the same configuration will look like the following:
56+
57+
```yaml
58+
apiVersion: networking.k8s.io/v1
59+
kind: Ingress
60+
metadata:
61+
name: aks-helloworld
62+
spec:
63+
ingressClassName: webapprouting.kubernetes.azure.com # Set the ingress class property to refer to the application routing add-on ingress class
64+
rules:
65+
- http:
66+
host: aks-helloworld.<CLUSTER_SPECIFIC_DNS_ZONE> # Replace with your own hostname
67+
paths:
68+
- path: /
69+
pathType: Prefix
70+
backend:
71+
service:
72+
name: aks-helloworld
73+
port:
74+
number: 80
75+
```
76+
77+
3. Update the ingress controller's IP (such as in DNS records) with the new IP address. You can find the new IP by using `kubectl get`. For example:
78+
79+
```bash
80+
kubectl get svc nginx --namespace app-routing-system -o jsonpath='{.status.loadBalancer.ingress[0].ip}'
81+
```
82+
83+
4. Disable the HTTP application routing add-on.
84+
85+
```azurecli-interactive
86+
az aks disable-addons -g <ResourceGroupName> -n <ClusterName> --addons http_application_routing
87+
```
88+
89+
## Remove and delete all HTTP application routing resources
90+
91+
1. After the HTTP application routing add-on is disabled, some related Kubernetes resources may remain in your cluster. These resources include *configmaps* and *secrets* that are created in the *kube-system* namespace. To maintain a clean cluster, you may want to remove these resources. Look for *addon-http-application-routing* resources using the following [`kubectl get`][kubectl-get] commands:
92+
93+
```bash
94+
kubectl get deployments --namespace kube-system
95+
kubectl get services --namespace kube-system
96+
kubectl get configmaps --namespace kube-system
97+
kubectl get secrets --namespace kube-system
98+
```
99+
100+
The following example output shows *configmaps* that should be deleted:
101+
102+
```output
103+
NAMESPACE NAME DATA AGE
104+
kube-system addon-http-application-routing-nginx-configuration 0 9m7s
105+
kube-system addon-http-application-routing-tcp-services 0 9m7s
106+
kube-system addon-http-application-routing-udp-services 0 9m7s
107+
```
108+
109+
1. Delete remaining resources using the [`kubectl delete`][kubectl-delete] command. Make sure to specify the resource type, resource name, and namespace. The following example deletes one of the previous configmaps:
110+
111+
```bash
112+
kubectl delete configmaps addon-http-application-routing-nginx-configuration --namespace kube-system
113+
```
114+
115+
1. Repeat the previous `kubectl delete` step for all *addon-http-application-routing* resources remaining in your cluster.
116+
117+
## Next steps
118+
119+
After migrating to the application routing add-on, learn how to [monitor ingress controller metrics with Prometheus and Grafana](./app-routing-nginx-prometheus.md).
120+
121+
<!-- INTERNAL LINKS -->
122+
[install-azure-cli]: /cli/azure/install-azure-cli
123+
[ingress-https]: ./ingress-tls.md
124+
[app-routing-dns-create]: ./app-routing.md?tabs=without-osm#create-an-azure-dns-zone
125+
[app-routing-dns-configure]: ./app-routing.md?tabs=without-osm#configure-the-add-on-to-use-azure-dns-to-manage-dns-zones
126+
127+
<!-- EXTERNAL LINKS -->
128+
[dns-pricing]: https://azure.microsoft.com/pricing/details/dns/
129+
[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get
130+
[kubectl-delete]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#delete

articles/aks/http-application-routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ ms.author: allensu
1212
# HTTP application routing add-on for Azure Kubernetes Service (AKS)
1313

1414
> [!CAUTION]
15-
> The HTTP application routing add-on is in the process of being retired and isn't recommended for production use. We recommend using the [Application Routing add-on](./app-routing.md) instead.
15+
> The HTTP application routing add-on is in the process of being retired and isn't recommended for production use. We recommend migrating to the [Application Routing add-on](./app-routing-migration.md) instead.
1616
1717
The HTTP application routing add-on makes it easy to access applications that are deployed to your Azure Kubernetes Service (AKS) cluster by:
1818

0 commit comments

Comments
 (0)