Skip to content

Commit 79d820c

Browse files
committed
corrections
1 parent 9a2e2a9 commit 79d820c

File tree

1 file changed

+38
-35
lines changed

1 file changed

+38
-35
lines changed

articles/azure-monitor/essentials/integrate-keda.md

Lines changed: 38 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,28 @@ ms.date: 05/31/2023
1111

1212
# Integrate KEDA with your Azure Kubernetes Service cluster
1313

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.
1515

1616
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.
1717

1818
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.
1925

2026
## Prerequisites
2127

2228
1. Azure Kubernetes Service (AKS) cluster
2329
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).
2430

2531

26-
> [!NOTE]
27-
> The KEDA addon (preview) for AKS does not currently support managed prometheus.
28-
2932
## Set up a workload identity
3033

3134
1. Start by setting up some environment variables. Change the values to suit your AKS cluster.
3235

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-
3836
```bash
3937
export RESOURCE_GROUP="rg-keda-integration"
4038
export LOCATION="eastus"
@@ -45,6 +43,11 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
4543
export SERVICE_ACCOUNT_NAME="keda-operator"
4644
```
4745

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+
4851
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.
4952

5053
```azurecli
@@ -133,38 +136,38 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
133136
az identity federated-credential create --name $FEDERATED_IDENTITY_CREDENTIAL_NAME --identity-name $USER_ASSIGNED_IDENTITY_NAME --resource-group $RESOURCE_GROUP --issuer $AKS_OIDC_ISSUER --subject system:serviceaccount:$SERVICE_ACCOUNT_NAMESPACE:$SERVICE_ACCOUNT_NAME --audience api://AzureADTokenExchange
134137
```
135138

136-
## Deploy KEDA
139+
> [!Note]
140+
> 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.
137141

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
139143

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/)
141145

146+
Deploy KEDA using the following command.
142147

143-
```bash
144-
helm install keda kedacore/keda --namespace keda \
145-
--set podIdentity.azureWorkload.enabled=true \
146-
--set podIdentity.azureWorkload.clientId=$USER_ASSIGNED_CLIENT_ID \
147-
--set podIdentity.azureWorkload.tenantId=$TENANT_ID
148-
```
149-
150-
1. Check your deployment by running the following command.
151-
```bash
152-
kubectl get pods -n keda
153-
```
154-
The output will be similar to the following:
148+
```bash
149+
helm install keda kedacore/keda --namespace keda \
150+
--set podIdentity.azureWorkload.enabled=true \
151+
--set podIdentity.azureWorkload.clientId=$USER_ASSIGNED_CLIENT_ID \
152+
--set podIdentity.azureWorkload.tenantId=$TENANT_ID
153+
```
155154

156-
```bash
157-
NAME READY STATUS RESTARTS AGE
158-
keda-admission-webhooks-ffcb8f688-kqlxp 1/1 Running 0 4m
159-
keda-operator-5d9f7d975-mgv7r 1/1 Running 1 (4m ago) 4m
160-
keda-operator-metrics-apiserver-7dc6f59678-745nz 1/1 Running 0 4m
161-
```
155+
Check your deployment by running the following command.
156+
```bash
157+
kubectl get pods -n keda
158+
```
159+
The output will be similar to the following:
162160

163-
## Scalers
161+
```bash
162+
NAME READY STATUS RESTARTS AGE
163+
keda-admission-webhooks-ffcb8f688-kqlxp 1/1 Running 0 4m
164+
keda-operator-5d9f7d975-mgv7r 1/1 Running 1 (4m ago) 4m
165+
keda-operator-metrics-apiserver-7dc6f59678-745nz 1/1 Running 0 4m
166+
```
164167

165-
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
166169

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.
168171

169172
```yml
170173
apiVersion: keda.sh/v1alpha1
@@ -173,7 +176,7 @@ metadata:
173176
name: azure-managed-prometheus-trigger-auth
174177
spec:
175178
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
177180
identityId: <identity-id> # Optional. Default: Identity linked with the label set when installing KEDA.
178181
---
179182
apiVersion: keda.sh/v1alpha1
@@ -196,7 +199,7 @@ spec:
196199
authenticationRef:
197200
name: azure-managed-prometheus-trigger-auth
198201
```
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)
200203
+ `metricName` is the name of the metric you want to scale on.
201204
+ `query` is the query used to retrieve the metric.
202205
+ `threshold` is the value at which the deployment scales.

0 commit comments

Comments
 (0)