Azure / AKS

Azure Kubernetes Service
https://azure.github.io/AKS/
1.95k stars 304 forks source link

[Feature] Add Prometheus scrape config to Keda add-on Helm chart values #4090

Open EppO opened 7 months ago

EppO commented 7 months ago

Is your feature request related to a problem? Please describe. When deploying Keda as an AKS add-on, the metrics exposed by the Keda operator cannot be scraped by Azure Monitor’s managed service for Prometheus. This limitation arises because the Keda operator lacks the necessary Prometheus scrape configuration annotations.

Describe the solution you'd like To address this issue, we can add the following annotations to the keda-operator service:

prometheus.io/scrape: "true"
prometheus.io/port: 8080
prometheus.io/path: "/metrics"

The Keda Helm chart, which the add-on utilizes under the hood, already supports these annotations. By setting the following values in the Helm chart’s values file, we can expose the necessary annotations:

prometheus:
  operator:
    enabled: true
  metricServer:
    enabled: true

Describe alternatives you've considered While manually installing Keda is an option, the add-on should ideally cover this use case seamlessly.

Additional context It’s important to note that setting .Values.prometheus.operator.enabled does not necessarily imply the use of the Prometheus operator. As long as .Values.prometheus.operator.podMonitor.enabled and .Values.prometheus.operator.serviceMonitor.enabled remain false (which is the default), only the Prometheus scrape annotations will be generated.

qpetraroia commented 6 months ago

Hey @EppO,

Thanks for opening this up. We will take a look at this and bump this thread once we have an answer.

EppO commented 5 months ago

Hi @qpetraroia, do you have any updates to share with us? I assume the chart values used by the AKS add-on are not public otherwise I would volunteer to create a PR to implement this.

Rick-healy commented 3 months ago

I'm interested in this also for any updates? Currently had to revert back to Helm chart deployment with custom config-values.yaml for the annotations.

EppO commented 3 months ago

@Rick-healy: as workaround, you can use Service Monitor CRD to make Azure Managed Prometheus discover KEDA targets.