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/azure-monitor/essentials/integrate-keda.md
+38-35Lines changed: 38 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,30 +11,28 @@ ms.date: 05/31/2023
11
11
12
12
# Integrate KEDA with your Azure Kubernetes Service cluster
13
13
14
-
KEDA is a Kubernetes-based Event Driven Autoscaler. KEDA lets you can drive the scaling of any container in Kubernetes based on the load to be processed, by querying metrics from systems such as Prometheus. Integrate KEDA with your Azure Kubernetes Service (AKS) cluster to scale your workloads based on Prometheus metrics from your Azure Monitor workspace.
14
+
KEDA is a Kubernetes-based Event Driven Autoscaler. KEDA lets you drive the scaling of any container in Kubernetes based on the load to be processed, by querying metrics from systems such as Prometheus. Integrate KEDA with your Azure Kubernetes Service (AKS) cluster to scale your workloads based on Prometheus metrics from your Azure Monitor workspace.
15
15
16
16
To integrate KEDA into your Azure Kubernetes Service, you have to deploy and configure a workload identity or pod identity on your cluster. The identity allows KEDA to authenticate with Azure and retrieve metrics for scaling from your Monitor workspace.
17
17
18
18
This article walks you through the steps to integrate KEDA into your AKS cluster using a workload identity.
19
+
Note
20
+
21
+
>[!NOTE]
22
+
> We recommend using Azure Active Directory workload identity. This authentication method replaces pod-managed identity (preview), which integrates with the Kubernetes native capabilities to federate with any external identity providers on behalf of the application.
23
+
24
+
> The open source Azure AD pod-managed identity (preview) in Azure Kubernetes Service has been deprecated as of 10/24/2022, and the project will be archived in Sept. 2023. For more information, see the deprecation notice. The AKS Managed add-on begins deprecation in Sept. 2023.
19
25
20
26
## Prerequisites
21
27
22
28
1. Azure Kubernetes Service (AKS) cluster
23
29
1. Prometheus sending metrics to an Azure Monitor workspace. For more information, see [Azure Monitor managed service for Prometheus](hhttps://learn.microsoft.com/en-us/azure/azure-monitor/essentials/prometheus-metrics-overview).
24
30
25
31
26
-
> [!NOTE]
27
-
> The KEDA addon (preview) for AKS does not currently support managed prometheus.
28
-
29
32
## Set up a workload identity
30
33
31
34
1. Start by setting up some environment variables. Change the values to suit your AKS cluster.
32
35
33
-
Don't change the values for `SERVICE_ACCOUNT_NAMESPACE` and `SERVICE_ACCOUNT_NAME`. They're the namespace and name of the kubernetes service account that KEDA uses to authenticate with Azure.
34
-
35
-
`USER_ASSIGNED_IDENTITY_NAME`is the name of the Azure Active directory identity that's created for KEDA.
36
-
`FEDERATED_IDENTITY_CREDENTIAL_NAME`is the name of the credential that's created for KEDA to use to authenticate with Azure.
37
-
38
36
```bash
39
37
export RESOURCE_GROUP="rg-keda-integration"
40
38
export LOCATION="eastus"
@@ -45,6 +43,11 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
45
43
export SERVICE_ACCOUNT_NAME="keda-operator"
46
44
```
47
45
46
+
+ `SERVICE_ACCOUNT_NAME` - KEDA must use the service account that was used to create federated credentials.
47
+
+ `SERVICE_ACCOUNT_NAMESPACE` Both KEDA and service account must be in same namespace.
48
+
+ `USER_ASSIGNED_IDENTITY_NAME` is the name of the Azure Active directory identity that's created for KEDA.
49
+
+ `FEDERATED_IDENTITY_CREDENTIAL_NAME` is the name of the credential that's created for KEDA to use to authenticate with Azure.
50
+
48
51
1. If your AKS cluster hasn't been created with workload-identity or oidc-issuer enabled, you'll need to enable it. If you aren't sure, you can run the following command to check if it's enabled.
49
52
50
53
```azurecli
@@ -133,38 +136,38 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
> It takes a few seconds for the federated identity credential to be propagated after being initially added. If a token request is made immediately after adding the federated identity credential, it might lead to failure for a couple of minutes as the cache is populated in the directory with old data. To avoid this issue, you can add a slight delay after adding the federated identity credential.
137
141
138
-
KEDA can be deployed using YAML manifests or Helm charts. This article uses Helm charts. For more information on deploying KEDA, see [Deploying KEDA](https://keda.sh/docs/2.10/deploy/)
142
+
## Deploy KEDA
139
143
140
-
1. Deply KEDA using the following command.
144
+
KEDA can be deployed using YAML manifests, Helm charts, or Operator Hub. This article uses Helm charts. For more information on deploying KEDA, see [Deploying KEDA](https://keda.sh/docs/2.10/deploy/)
141
145
146
+
Deploy KEDA using the following command.
142
147
143
-
```bash
144
-
helm install keda kedacore/keda --namespace keda \
Scalers define how and when KEDA should scale a deployment. KEDA supports a variety of scalers. For more information on scalers, see [Scalers](https://keda.sh/docs/2.10/scalers/prometheus/)
168
+
## Scalers
166
169
167
-
The following yaml file defines a scaler.
170
+
Scalers define how and when KEDA should scale a deployment. KEDA supports a variety of scalers. For more information on scalers, see [Scalers](https://keda.sh/docs/2.10/scalers/prometheus/). Azure Managed Prometheus utilizes already existing Prometheus scaler to retrieve Prometheus metrics from Azure Monitor Workspace. The following yaml file is an example to use Azure Managed Prometheus.
168
171
169
172
```yml
170
173
apiVersion: keda.sh/v1alpha1
@@ -173,7 +176,7 @@ metadata:
173
176
name: azure-managed-prometheus-trigger-auth
174
177
spec:
175
178
podIdentity:
176
-
: azure-workload | azure # use "azure" for pod identity and "azure-workload" for workload identity
179
+
provider: azure-workload | azure # use "azure" for pod identity and "azure-workload" for workload identity
177
180
identityId: <identity-id> # Optional. Default: Identity linked with the label set when installing KEDA.
178
181
---
179
182
apiVersion: keda.sh/v1alpha1
@@ -196,7 +199,7 @@ spec:
196
199
authenticationRef:
197
200
name: azure-managed-prometheus-trigger-auth
198
201
```
199
-
+ `serverAddress` is the Query endpoint of your Azure Monitor workspace.
202
+
+ `serverAddress` is the Query endpoint of your Azure Monitor workspace. For more information,see [Query Prometheus metrics using the API and PromQL](./prometheus-api-promql.md#query-endpoint)
200
203
+ `metricName` is the name of the metric you want to scale on.
201
204
+ `query` is the query used to retrieve the metric.
202
205
+ `threshold` is the value at which the deployment scales.
0 commit comments