Report
After configuring a Metrics API scaler with aggregateFromKubeServiceEndpoints: true and the URL of a headless service, pods unrelated to the service started to receive requests from the scaler.
It manifested as 404 errors in the logs of the unrelated pods, with the source IP being that of the KEDA operator pod. Only pods in the same namespace as the service are affected (ie. not cluster wide).
Expected Behavior
KEDA should only query pods (endpoints) belonging to the service specified in the url metadata field.
Actual Behavior
All pods from the namespace are receiving requests from the KEDA operator.
Steps to Reproduce the Problem
- Deploy two headless services (A and B) in the same namespace and each with ready pods
- Create a ScaledObject with type: metrics-api,
aggregateFromKubeServiceEndpoints: "true", targeting services A
- Observe logs of the service B and see requests from KEDA Operator targeting the URL configured in the ScaledObject
Logs from KEDA operator
n/a
KEDA Version
2.19.0
Kubernetes Version
1.34
Platform
Google Cloud
Scaler Details
Metrics API
Would you be open to contributing a fix?
Yes
Anything else?
No response
Report
After configuring a Metrics API scaler with
aggregateFromKubeServiceEndpoints: trueand the URL of a headless service, pods unrelated to the service started to receive requests from the scaler.It manifested as 404 errors in the logs of the unrelated pods, with the source IP being that of the KEDA operator pod. Only pods in the same namespace as the service are affected (ie. not cluster wide).
Expected Behavior
KEDA should only query pods (endpoints) belonging to the service specified in the url metadata field.
Actual Behavior
All pods from the namespace are receiving requests from the KEDA operator.
Steps to Reproduce the Problem
aggregateFromKubeServiceEndpoints: "true", targeting services ALogs from KEDA operator
n/a
KEDA Version
2.19.0
Kubernetes Version
1.34
Platform
Google Cloud
Scaler Details
Metrics API
Would you be open to contributing a fix?
Yes
Anything else?
No response