Skip to content

Commit d978043

Browse files
authored
Merge pull request #287362 from ShawnJackson/articles-about-ingress-for-aks
[AQ] edit pass: Articles about ingress for AKS
2 parents dca2a4b + 9555d70 commit d978043

12 files changed

+478
-479
lines changed
Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Add health probes to your AKS pods
3-
description: This article provides information on how to add health probes (readiness and/or liveness) to AKS pods with an Application Gateway.
3+
description: This article provides information on how to add readiness or liveness health probes to AKS pods by using Application Gateway.
44
services: application-gateway
55
author: greg-lindsay
66
ms.service: azure-application-gateway
@@ -9,14 +9,12 @@ ms.date: 9/17/2024
99
ms.author: greglin
1010
---
1111

12-
# Add Health Probes to your service
13-
By default, Ingress controller provisions an HTTP GET probe for the exposed pods.
14-
The probe properties can be customized by adding a [Readiness or Liveness Probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) to your `deployment`/`pod` spec.
12+
# Add health probes to your AKS pods
1513

16-
> [!TIP]
17-
> Also see [What is Application Gateway for Containers](for-containers/overview.md).
14+
By default, the Application Gateway Ingress Controller (AGIC) provisions an HTTP `GET` probe for exposed Azure Kubernetes Service (AKS) pods. You can customize the probe properties by adding a [readiness or liveness probe](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/) to your deployment or pod specification.
15+
16+
## Code for adding a readiness or liveness probe
1817

19-
## With `readinessProbe` or `livenessProbe`
2018
```yaml
2119
apiVersion: networking.k8s.io/v1
2220
kind: Deployment
@@ -43,25 +41,31 @@ spec:
4341
timeoutSeconds: 1
4442
```
4543
46-
Kubernetes API Reference:
47-
* [Container Probes](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#httpgetaction-v1-core)
44+
For more information, see the [Kubernetes API reference](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#httpgetaction-v1-core).
4845
4946
> [!NOTE]
50-
> * `readinessProbe` and `livenessProbe` are supported when configured with `httpGet`.
51-
> * Probing on a port other than the one exposed on the pod is currently not supported.
52-
> * `HttpHeaders`, `InitialDelaySeconds`, `SuccessThreshold` aren't supported.
47+
> - `readinessProbe` and `livenessProbe` are supported when you configure them with `httpGet`.
48+
> - Probing on a port other than the one exposed on the pod is currently not supported.
49+
> - `HttpHeaders`, `InitialDelaySeconds`, and `SuccessThreshold` aren't supported.
50+
51+
If the code doesn't include a readiness or liveness probe, the ingress controller makes an assumption that the service is reachable on either:
52+
53+
- The `Path` value that's specified for `backend-path-prefix` annotation
54+
- The `path` value that's specified in the `ingress` definition for the service
5355

54-
## Without `readinessProbe` or `livenessProbe`
55-
If the above probes aren't provided, then the Ingress Controller makes an assumption that the service is reachable on the `Path` specified for `backend-path-prefix` annotation, or the `path` specified in the `ingress` definition for the service.
56+
## Default values for the health probe
5657

57-
## Default Values for Health Probe
58-
For any property that can't be inferred by the readiness/liveness probe, default values are set.
58+
Any property that the readiness or liveness probe can't infer uses the following default values.
5959

60-
| Application Gateway Probe Property | Default Value |
60+
| Application Gateway probe property | Default value |
6161
|-|-|
62-
| `Path` | / |
63-
| `Host` | localhost |
64-
| `Protocol` | HTTP |
65-
| `Timeout` | 30 |
66-
| `Interval` | 30 |
67-
| `UnhealthyThreshold` | 3 |
62+
| `Path` | `/` |
63+
| `Host` | `localhost` |
64+
| `Protocol` | `HTTP` |
65+
| `Timeout` | `30` |
66+
| `Interval` | `30` |
67+
| `UnhealthyThreshold` | `3` |
68+
69+
## Related content
70+
71+
- [What is Application Gateway for Containers?](for-containers/overview.md)

articles/application-gateway/ingress-controller-autoscale-pods.md

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Autoscale AKS pods with Azure Application Gateway metrics
3-
description: This article provides instructions on how to scale your AKS backend pods using Application Gateway metrics and Azure Kubernetes Metric Adapter
3+
description: This article provides instructions on how to scale your AKS back-end pods by using Application Gateway metrics and the Azure Kubernetes Metrics Adapter.
44
services: application-gateway
55
author: greg-lindsay
66
ms.service: azure-application-gateway
@@ -10,35 +10,31 @@ ms.date: 9/17/2024
1010
ms.author: greglin
1111
---
1212

13-
# Autoscale your AKS pods using Application Gateway Metrics (Beta)
13+
# Autoscale your AKS pods by using Application Gateway metrics
1414

1515
As incoming traffic increases, it becomes crucial to scale up your applications based on the demand.
1616

17-
In the following tutorial, we explain how you can use Application Gateway's `AvgRequestCountPerHealthyHost` metric to scale up your application. `AvgRequestCountPerHealthyHost` measures average requests sent to a specific backend pool and backend HTTP setting combination.
17+
This article explains how you can use the `AvgRequestCountPerHealthyHost` metric in Azure Application Gateway to scale up Azure Kubernetes Service (AKS) pods for an application. The `AvgRequestCountPerHealthyHost` metric measures average requests sent to a specific combination of a back-end pool and a back-end HTTP setting.
1818

19-
Use following two components:
19+
Use the following two components:
2020

21-
* [`Azure Kubernetes Metric Adapter`](https://github.com/Azure/azure-k8s-metrics-adapter) - We use the metric adapter to expose Application Gateway metrics through the metric server. The Azure Kubernetes Metric Adapter is an open source project under Azure, similar to the Application Gateway Ingress Controller.
22-
* [`Horizontal Pod Autoscaler`](/azure/aks/concepts-scale#horizontal-pod-autoscaler) - We use HPA to use Application Gateway metrics and target a deployment for scaling.
21+
- [Azure Kubernetes Metrics Adapter](https://github.com/Azure/azure-k8s-metrics-adapter): You use this component to expose Application Gateway metrics through the metric server. It's an open-source project under Azure, similar to the Application Gateway Ingress Controller.
22+
- [Horizontal Pod Autoscaler](/azure/aks/concepts-scale#horizontal-pod-autoscaler): You use this component to apply Application Gateway metrics and target a deployment for scaling.
2323

2424
> [!NOTE]
25-
> The Azure Kubernetes Metrics Adapter is no longer maintained. Kubernetes Event-driven Autoscaling (KEDA) is an alternative.<br>
26-
> Also see [Application Gateway for Containers](for-containers/overview.md).
25+
> The Azure Kubernetes Metrics Adapter is no longer maintained. Kubernetes Event-driven Autoscaling (KEDA) is an alternative.
2726
28-
> [!TIP]
29-
> Also see [What is Application Gateway for Containers](for-containers/overview.md).
27+
## Set up the Azure Kubernetes Metrics Adapter
3028

31-
## Setting up Azure Kubernetes Metric Adapter
32-
33-
1. First, create a Microsoft Entra service principal and assign it `Monitoring Reader` access over Application Gateway's resource group.
29+
1. Create a Microsoft Entra service principal and assign it `Monitoring Reader` access over the Application Gateway instance's resource group:
3430

3531
```azurecli
3632
applicationGatewayGroupName="<application-gateway-group-id>"
3733
applicationGatewayGroupId=$(az group show -g $applicationGatewayGroupName -o tsv --query "id")
3834
az ad sp create-for-rbac -n "azure-k8s-metric-adapter-sp" --role "Monitoring Reader" --scopes applicationGatewayGroupId
3935
```
4036
41-
1. Now, deploy the [`Azure Kubernetes Metric Adapter`](https://github.com/Azure/azure-k8s-metrics-adapter) using the Microsoft Entra service principal created previously.
37+
1. Deploy the Azure Kubernetes Metrics Adapter by using the Microsoft Entra service principal that you created previously:
4238
4339
```bash
4440
kubectl create namespace custom-metrics
@@ -50,7 +46,7 @@ Use following two components:
5046
kubectl apply -f kubectl apply -f https://raw.githubusercontent.com/Azure/azure-k8s-metrics-adapter/master/deploy/adapter.yaml -n custom-metrics
5147
```
5248
53-
1. Create an `ExternalMetric` resource with name `appgw-request-count-metric`. This resource instructs the metric adapter to expose `AvgRequestCountPerHealthyHost` metric for `myApplicationGateway` resource in `myResourceGroup` resource group. You can use the `filter` field to target a specific backend pool and backend HTTP setting in the Application Gateway.
49+
1. Create an `ExternalMetric` resource with the name `appgw-request-count-metric`. This resource instructs the metric adapter to expose the `AvgRequestCountPerHealthyHost` metric for the `myApplicationGateway` resource in the `myResourceGroup` resource group. You can use the `filter` field to target a specific back-end pool and back-end HTTP setting in the Application Gateway instance.
5450
5551
```yaml
5652
apiVersion: azure.com/v1alpha2
@@ -60,8 +56,8 @@ Use following two components:
6056
spec:
6157
type: azuremonitor
6258
azure:
63-
resourceGroup: myResourceGroup # replace with your application gateway's resource group name
64-
resourceName: myApplicationGateway # replace with your application gateway's name
59+
resourceGroup: myResourceGroup # replace with your Application Gateway instance's resource group name
60+
resourceName: myApplicationGateway # replace with your Application Gateway instance's name
6561
resourceProviderNamespace: Microsoft.Network
6662
resourceType: applicationGateways
6763
metric:
@@ -70,7 +66,8 @@ Use following two components:
7066
filter: BackendSettingsPool eq '<backend-pool-name>~<backend-http-setting-name>' # optional
7167
```
7268
73-
You can now make a request to the metric server to see if our new metric is getting exposed:
69+
You can now make a request to the metric server to see if the new metric is being exposed:
70+
7471
```bash
7572
kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/default/appgw-request-count-metric"
7673
# Sample Output
@@ -93,13 +90,14 @@ kubectl get --raw "/apis/external.metrics.k8s.io/v1beta1/namespaces/default/appg
9390
# }
9491
```
9592

96-
## Using the new metric to scale up the deployment
93+
## Use the new metric to scale up the deployment
94+
95+
After you expose `appgw-request-count-metric` through the metric server, you're ready to use the [Horizontal Pod Autoscaler](/azure/aks/concepts-scale#horizontal-pod-autoscaler) to scale up your target deployment.
9796

98-
Once we're able to expose `appgw-request-count-metric` through the metric server, we're ready to use [`Horizontal Pod Autoscaler`](/azure/aks/concepts-scale#horizontal-pod-autoscaler) to scale up our target deployment.
97+
The following example targets a sample deployment named `aspnet`. You scale up pods when `appgw-request-count-metric` is `200` per pod, up to a maximum of `10` pods.
9998

100-
In following example, we target a sample deployment `aspnet`. We scale up Pods when `appgw-request-count-metric` > 200 per Pod up to a max of `10` Pods.
99+
Replace your target deployment name and apply the following autoscale configuration:
101100

102-
Replace your target deployment name and apply the following auto scale configuration:
103101
```yaml
104102
apiVersion: autoscaling/v2
105103
kind: HorizontalPodAutoscaler
@@ -119,10 +117,13 @@ spec:
119117
targetAverageValue: 200
120118
```
121119
122-
Test your setup by using a load test tool like apache bench:
120+
Test your setup by using a load test tool like ApacheBench:
121+
123122
```bash
124123
ab -n10000 http://<applicaiton-gateway-ip-address>/
125124
```
126125

127126
## Next steps
128-
- [**Troubleshoot Ingress Controller issues**](ingress-controller-troubleshoot.md): Troubleshoot any issues with the Ingress Controller.
127+
128+
- [Troubleshoot Application Gateway Ingress Controller issues](ingress-controller-troubleshoot.md)
129+
- [What is Application Gateway for Containers?](for-containers/overview.md)

articles/application-gateway/ingress-controller-cookie-affinity.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Enable cookie based affinity with Application Gateway
3-
description: This article provides information on how to enable cookie-based affinity with an Application Gateway.
2+
title: Enable cookie-based affinity with Application Gateway
3+
description: This article provides information on how to enable cookie-based affinity with Application Gateway.
44
services: application-gateway
55
author: greg-lindsay
66
ms.service: azure-application-gateway
@@ -9,13 +9,12 @@ ms.date: 9/17/2024
99
ms.author: greglin
1010
---
1111

12-
# Enable Cookie based affinity with an Application Gateway
13-
As outlined in the [Azure Application Gateway Documentation](./application-gateway-components.md#http-settings), Application Gateway supports cookie based affinity, which means it can direct subsequent traffic from a user session to the same server for processing.
12+
# Enable cookie-based affinity with Application Gateway
1413

15-
> [!TIP]
16-
> Also see [What is Application Gateway for Containers](for-containers/overview.md).
14+
As outlined in the [Azure Application Gateway documentation](./application-gateway-components.md#http-settings), Application Gateway supports cookie-based affinity. This support means that the service can direct subsequent traffic from a user session to the same server for processing.
1715

1816
## Example
17+
1918
```yaml
2019
apiVersion: networking.k8s.io/v1
2120
kind: Ingress
@@ -31,4 +30,8 @@ spec:
3130
- backend:
3231
serviceName: frontend
3332
servicePort: 80
34-
```
33+
```
34+
35+
## Related content
36+
37+
- [What is Application Gateway for Containers?](for-containers/overview.md)
Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Disable and re-enable Application Gateway Ingress Controller add-on for Azure Kubernetes Service cluster
3-
description: This article provides information on how to disable and re-enable the AGIC add-on for your AKS cluster
3+
description: This article provides information on how to disable and re-enable the AGIC add-on for your AKS cluster.
44
services: application-gateway
55
author: greg-lindsay
66
ms.service: azure-application-gateway
@@ -9,34 +9,42 @@ ms.date: 9/17/2024
99
ms.author: greglin
1010
---
1111

12-
# Disable and re-enable AGIC add-on for your AKS cluster
13-
Application Gateway Ingress Controller (AGIC) deployed as an AKS add-on allows you to enable and disable the add-on with one line in Azure CLI. The life cycle of the Application Gateway differs when you disable the AGIC add-on, depending on if the Application Gateway was created by the AGIC add-on, or if it was deployed separately from the AGIC add-on. You can run the same command to re-enable the AGIC add-on if you ever disable it, or to enable the AGIC add-on using an existing AKS cluster and Application Gateway.
12+
# Disable and re-enable the AGIC add-on for your AKS cluster
1413

15-
> [!TIP]
16-
> Also see [What is Application Gateway for Containers](for-containers/overview.md).
14+
When you deploy the Application Gateway Ingress Controller (AGIC) as an Azure Kubernetes Service (AKS) add-on, you can enable and disable the add-on with one line in the Azure CLI.
15+
16+
The life cycle of the Azure Application Gateway instance differs when you disable the AGIC add-on, depending on whether you created the Application Gateway instance by using the AGIC add-on or you deployed it separately from the add-on. You can run the same command to re-enable the AGIC add-on if you ever disable it, or to enable the AGIC add-on by using an existing AKS cluster and Application Gateway instance.
17+
18+
## Disable the AGIC add-on with an associated Application Gateway instance
1719

18-
## Disabling AGIC add-on with associated Application Gateway
19-
If the AGIC add-on automatically deployed the Application Gateway for you when you first set up everything, then disabling the AGIC add-on will by default delete the Application Gateway based on a couple criteria. There are two criteria that the AGIC add-on looks for to determine if it should delete the associated Application Gateway when you disable it:
20-
- Is the Application Gateway that the AGIC add-on is associated with deployed in the MC_* node resource group?
21-
- Does the Application Gateway that the AGIC add-on is associated with have the tag "created-by: ingress-appgw"? The tag is used by AGIC to determine if the Application Gateway was deployed by the add-on or not.
20+
If the AGIC add-on automatically deployed the Application Gateway instance for you when you first set up everything, then disabling the AGIC add-on might delete the Application Gateway instance by default. The AGIC add-on considers two criteria to determine if it should delete the associated Application Gateway instance:
2221

23-
If both criteria are met, then the AGIC add-on will delete the Application Gateway it created when the add-on is disabled; however, it won't delete the public IP or the subnet in which the Application Gateway was deployed with/in. If the first criteria isn't met, then it won't matter if the Application Gateway has the "created-by: ingress-appgw" tag - disabling the add-on won't delete the Application Gateway. Likewise, if the second criteria isn't met, that is. The Application Gateway lacks that tag, then disabling the add-on won't delete the Application Gateway in the MC_* node resource group.
22+
- Is the Application Gateway instance deployed in the `MC_*` node resource group?
23+
- Does the Application Gateway instance have the tag `created-by: ingress-appgw`? AGIC uses the tag to determine whether or not the add-on deployed the Application Gateway instance.
2424

25-
> [!TIP]
26-
> If you don't want the Application Gateway to be deleted when disabling the add-on, but it meets both criteria then remove the "created-by: ingress-appgw" tag to prevent the add-on from deleting your Application Gateway.
25+
If both criteria are met, the AGIC add-on deletes the Application Gateway instance when you disable the add-on. However, the AGIC add-on doesn't delete the public IP address or the subnet in which it deployed the Application Gateway instance.
26+
27+
If the first criterion isn't met, disabling the add-on doesn't delete the Application Gateway instance, even if the instance has the `created-by: ingress-appgw` tag. Likewise, if the second criterion isn't met (that is, the Application Gateway instance lacks that tag), disabling the add-on doesn't delete the Application Gateway instance in the `MC_*` node resource group.
28+
29+
> [!TIP]
30+
> If you don't want the add-on to delete your Application Gateway instance when you disable the add-on, but the instance meets both criteria, remove the `created-by: ingress-appgw` tag.
31+
32+
To disable the AGIC add-on, run the following command:
2733

28-
To disable the AGIC add-on, run the following command:
2934
```azurecli-interactive
3035
az aks disable-addons -n <AKS-cluster-name> -g <AKS-resource-group-name> -a ingress-appgw
3136
```
3237

33-
## Enable AGIC add-on on existing Application Gateway and AKS Cluster
34-
If you ever disable the AGIC add-on and need to re-enable the add-on, or want to enable the add-on using an existing Application Gateway and AKS cluster, then run the following command:
38+
## Enable the AGIC add-on on an existing Application Gateway instance and AKS cluster
39+
40+
If you ever disable the AGIC add-on and need to re-enable it, or you want to enable the add-on by using an existing Application Gateway instance and AKS cluster, run the following command:
3541

3642
```azurecli-interactive
3743
appgwId=$(az network application-gateway show -n <application-gateway-name> -g <resource-group-name> -o tsv --query "id")
3844
az aks enable-addons -n <AKS-cluster-name> -g <AKS-cluster-resource-group> -a ingress-appgw --appgw-id $appgwId
3945
```
4046

41-
## Next steps
42-
For more information on how to enable the AGIC add-on using an existing Application Gateway and AKS cluster, see [AGIC add-on brownfield deployment](tutorial-ingress-controller-add-on-existing.md).
47+
## Related content
48+
49+
- For more information on how to enable the AGIC add-on by using an existing Application Gateway instance and AKS cluster, see [this tutorial](tutorial-ingress-controller-add-on-existing.md).
50+
- For information about Application Gateway for Containers, see [What is Application Gateway for Containers?](for-containers/overview.md).

0 commit comments

Comments
 (0)