kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.58k stars 1.08k forks source link

pollingInterval: is not working as expected #6168

Closed MounaVignesh closed 3 days ago

MounaVignesh commented 2 months ago

Report

Im using app.kubernetes.io/version=2.15.1 with below HPA.yml file.. 

HPA.yml 

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: temp-uat-user
spec:
  scaleTargetRef:
    name: temp-uat-user
  pollingInterval: 60  # Poll every 60 seconds
  cooldownPeriod: 120   # Scale down cooldown period
  minReplicaCount:  2                               # Optional. Default: 0
  maxReplicaCount:  4
  triggers:
    - type: prometheus
      metadata:
        serverAddress: http://prom-kube-prometheus-stack-prometheus.prometheus.svc.cluster.local:9090
        metricName: http_server_requests_seconds # Note: name to identify the metric, generated value would be `prometheus-http_requests_total`
        activationThreshold: '5.5'
        query: sum(rate(http_server_requests_seconds_count{app="temp-uat-user"}[1m]))
        threshold: '2000'

    =======================================

    kubectl get hpa keda-hpa-temp-uat-user -w |  awk '{ print strftime("[%Y-%m-%d %H:%M:%S]"), $0 }'
[2024-09-16 18:11:20] NAME                                 REFERENCE                              TARGETS              MINPODS   MAXPODS   REPLICAS   AGE
[2024-09-16 18:11:20] keda-hpa-temp-uat-user   Deployment/temp-uat-user   <unknown>/2k (avg)   2         4         0          10s
[2024-09-16 18:11:25] keda-hpa-temp-uat-user   Deployment/temp-uat-user   1150m/2k (avg)       2         4         2          15s
[2024-09-16 18:11:55] keda-hpa-temp-uat-user   Deployment/temp-uat-user   1850m/2k (avg)       2         4         2          45s
[2024-09-16 18:12:25] keda-hpa-temp-uat-user   Deployment/temp-uat-user   2233m/2k (avg)       2         4         2          75s
[2024-09-16 18:12:55] keda-hpa-temp-uat-user   Deployment/temp-uat-user   1950m/2k (avg)       2         4         2          105s
[2024-09-16 18:13:25] keda-hpa-temp-uat-user   Deployment/temp-uat-user   2/2k (avg)           2         4         2          2m15s    

=====================================================

**sudo kubectl get scaledobject temp-uat-user -oyaml | grep pollingInterval
  pollingInterval: 60**

Expected Behavior

pollingInterval: 60 is not working as expected and scale up and scale down also not working.

Actual Behavior

pollingInterval: 60 instead of this 30 seconds pollingInterval happening

Steps to Reproduce the Problem

  1. I want to check prometheus HTTP request for every 10seconds and scaling should happen using those metrics.

Logs from KEDA operator

example

KEDA Version

2.15.1

Kubernetes Version

1.29

Platform

Amazon Web Services

Scaler Details

prometheus custom metrics

Anything else?

No response

stale[bot] commented 1 week ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 days ago

This issue has been automatically closed due to inactivity.