My usecase is to scale the AKS POD based on application insights custom query results. But i am unable to find any example which does that. KEDA document only suggesting to use the built in metric id.
Below is something i wanted to achieve. But it always says the metric id not provided. But i wanted to use the custom query rather than existing metric id.
apiVersion: keda.sh/v1alpha1
kind: TriggerAuthentication
metadata:
name: trigger-podidentity-auth
spec:
podIdentity:
provider: azure-workload
identityId: 6d12e654-770d-4607-8a31-0ade5472e803
---
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: webapp-demo-scaleobject
namespace: demo-cluster-ns
spec:
scaleTargetRef:
name: webapp-demo
minReplicaCount: 1 #Change to define how many minimum replicas you want
maxReplicaCount: 4
triggers:
- type: azure-app-insights
metadata:
query: "requests | summarize sum(itemCount) by name | where name == 'GET WeatherForecast/Get' | project sum_itemCount"
timespan: "PT10S"
targetValue: "10"
authenticationRef:
name: trigger-podIdentity-auth
Any suggestions how to achieve using KEDA? Can it be achieved with the built in metric id?
That cannot be done using the Application Insights scaler.
If you have a workspace based application insights resource, or you are able to convert your classic resource, you can use the Azure Log Analytics scaler. An example from the docs: