Skip to content

Commit 292e4cb

Browse files
committed
Update KEDA integration document with some more instructions
1 parent a2ce195 commit 292e4cb

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

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

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
3333

3434
## Set up a workload identity
3535

36-
1. Start by setting up some environment variables. Change the values to suit your AKS cluster.
36+
1. Start by setting up some environment variables. Change the values to suit your AKS cluster.
3737

3838
```bash
3939
export RESOURCE_GROUP="rg-keda-integration"
@@ -43,9 +43,11 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
4343
export FEDERATED_IDENTITY_CREDENTIAL_NAME="kedaFedIdentity"
4444
export SERVICE_ACCOUNT_NAMESPACE="keda"
4545
export SERVICE_ACCOUNT_NAME="keda-operator"
46+
export AKS_CLUSTER_NAME="aks-cluster-name"
4647
```
4748

48-
+ `SERVICE_ACCOUNT_NAME` - KEDA must use the service account that was used to create federated credentials.
49+
+ `SERVICE_ACCOUNT_NAME` - KEDA must use the service account that was used to create federated credentials. This can be any user defined name.
50+
+ `AKS_CLUSTER_NAME`- The name of the AKS cluster where you want to deploy KEDA.
4951
+ `SERVICE_ACCOUNT_NAMESPACE` Both KEDA and service account must be in same namespace.
5052
+ `USER_ASSIGNED_IDENTITY_NAME` is the name of the Azure Active directory identity that's created for KEDA.
5153
+ `FEDERATED_IDENTITY_CREDENTIAL_NAME` is the name of the credential that's created for KEDA to use to authenticate with Azure.
@@ -66,13 +68,13 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
6668
1. Store the OIDC issuer url in an environment variable to be used later.
6769

6870
```bash
69-
export AKS_OIDC_ISSUER="$(az aks show -n $CLUSTER_NAME -g $RESOURCE_GROUP --query "oidcIssuerProfile.issuerUrl" -otsv)"
71+
export AKS_OIDC_ISSUER="$(az aks show -n $AKS_CLUSTER_NAME -g $RESOURCE_GROUP --query "oidcIssuerProfile.issuerUrl" -otsv)"
7072
```
7173

7274
1. Create a user assigned identity for KEDA. This identity is used by KEDA to authenticate with Azure Monitor.
7375

7476
```azurecli
75-
az identity create --name $USER_ASSIGNED_IDENTITY_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --subscription $SUBSCRIPTION
77+
az identity create --name $USER_ASSIGNED_IDENTITY_NAME --resource-group $RESOURCE_GROUP --location $LOCATION --subscription $SUBSCRIPTION
7678
```
7779

7880
The output will be similar to the following:
@@ -94,25 +96,25 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
9496

9597
1. Store the `clientId` and `tenantId` in environment variables to use later.
9698
```bash
97-
export USER_ASSIGNED_CLIENT_ID="$(az identity show --resource-group $RESOURCE_GROUP --name $USER_ASSIGNED_IDENTITY_NAME --query 'clientId' -otsv)"
98-
export TENANT_ID="$(az identity show --resource-group $RESOURCE_GROUP --name $USER_ASSIGNED_IDENTITY_NAME --query 'tenantId' -otsv)"
99+
export USER_ASSIGNED_CLIENT_ID="$(az identity show --resource-group $RESOURCE_GROUP --name $USER_ASSIGNED_IDENTITY_NAME --query 'clientId' -otsv)"
100+
export TENANT_ID="$(az identity show --resource-group $RESOURCE_GROUP --name $USER_ASSIGNED_IDENTITY_NAME --query 'tenantId' -otsv)"
99101
```
100102

101-
1. Assign the *Monitoring Data Reader* role to the identity for your Azure Monitor workspace. This role allows the identity to read metrics from your workspace.
103+
1. Assign the *Monitoring Data Reader* role to the identity for your Azure Monitor workspace. This role allows the identity to read metrics from your workspace. Replace the *Azure Monitor Workspace resource group* and *Azure Monitor Workspace name* with the resource group and name of the Azure Monitor workspace which is configured to collect metrics from the AKS cluster.
102104

103105
```azurecli
104106
az role assignment create \
105107
--assignee $USER_ASSIGNED_CLIENT_ID \
106108
--role "Monitoring Data Reader" \
107-
--scope /subscriptions/$SUBSCRIPTION/resourceGroups/<Azure Monitor Workspace resource group>/providers/microsoft.monitor/accounts/ <Azure monitor workspace name>
109+
--scope /subscriptions/$SUBSCRIPTION/resourceGroups/<Azure Monitor Workspace resource group>/providers/microsoft.monitor/accounts/<Azure monitor workspace name>
108110
```
109111

110112

111-
1. Create the KEDA namespace, then create Kubernetes service account. This service account is used by KEDA to authenticate with Azure.
113+
1. Create the KEDA namespace, then create Kubernetes service account. This service account is used by KEDA to authenticate with Azure.
112114

113115
```azurecli
114116
115-
az aks get-credentials -n $CLUSTER_NAME -g $RESOURCE_GROUP
117+
az aks get-credentials -n $AKS_CLUSTER_NAME -g $RESOURCE_GROUP
116118
117119
kubectl create namespace keda
118120
@@ -129,13 +131,13 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
129131

130132
1. Check your service account by running
131133
```bash
132-
kubectl describe serviceaccount workload-identity-sa -n keda
134+
kubectl describe serviceaccount $SERVICE_ACCOUNT_NAME -n keda
133135
```
134136

135137
1. Establish a federated credential between the service account and the user assigned identity. The federated credential allows the service account to use the user assigned identity to authenticate with Azure.
136138

137139
```azurecli
138-
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
140+
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
139141
```
140142

141143
> [!Note]
@@ -145,7 +147,14 @@ This article walks you through the steps to integrate KEDA into your AKS cluster
145147

146148
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/)
147149

148-
Deploy KEDA using the following command.
150+
Add helm repository:
151+
152+
```bash
153+
helm repo add kedacore https://kedacore.github.io/charts
154+
helm repo update
155+
```
156+
157+
Deploy KEDA using the following command:
149158

150159
```bash
151160
helm install keda kedacore/keda --namespace keda \

0 commit comments

Comments
 (0)