Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support adding HPA Standard Metrics to Scaled Object Spec #852

Closed
patnaikshekhar opened this issue May 22, 2020 · 6 comments
Closed

Support adding HPA Standard Metrics to Scaled Object Spec #852

patnaikshekhar opened this issue May 22, 2020 · 6 comments
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Milestone

Comments

@patnaikshekhar
Copy link
Contributor

patnaikshekhar commented May 22, 2020

Allow a user to add standard metrics to the scaled object spec so that the HPA created by KEDA contains those metrics

Use-Case

We need to be able to scale our pods based on queue depth as well as memory metrics. If we use KEDA only to scale based on queue depth and create another HPA to scale the deployment based on standard metrics (memory util) there is a conflict and the system reaches a unstable state.

Specification

  • Allow additional metrics to be specified in the Scaled Object spec. Example
apiVersion: keda.k8s.io/v1alpha1
kind: ScaledObject
metadata:
  name: azure-servicebus-queue-scaledobject
  namespace: default
spec:
  scaleTargetRef:
    deploymentName: azure-servicebus-queue-function
  triggers:
  - type: azure-servicebus
    metadata:
      # Required: queueName OR topicName and subscriptionName
      queueName: functions-sbqueue
      # or
      topicName: functions-sbtopic
      subscriptionName: sbtopic-sub1
      # Required: connection OR authenticationRef that defines connection
      connection: SERVICEBUS_CONNECTIONSTRING_ENV_NAME # reference to a connection string in deployment
      # or authenticationRef as defined below
      #
      # Optional
      queueLength: "5" # default 5
 additionalMetrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 50
    - type: Pods
      pods:
        metric:
          name: packets-per-second
        target:
          type: AverageValue
          averageValue: 1k
    - type: Object
      object:
        metric:
          name: requests-per-second
        describedObject:
          apiVersion: networking.k8s.io/v1beta1
          kind: Ingress
          name: main-route
        target:
          type: Value
          value: 10k
    authenticationRef:
        name: azure-servicebus-auth 
@patnaikshekhar patnaikshekhar added needs-discussion feature-request All issues for new features that have not been committed to labels May 22, 2020
@zroubalik
Copy link
Member

Thats' a great idea. We could introduce it in upcoming v2.

My only concern is the proposed specification. I am not sure if the triggers section is the right place for this fields.

@patnaikshekhar
Copy link
Contributor Author

Thats' a great idea. We could introduce it in upcoming v2.

My only concern is the proposed specification. I am not sure if the triggers section is the right place for this fields.

That is a typo I wanted to say that it should be at the same level as triggers.

@zroubalik
Copy link
Member

@patnaikshekhar why did you close this issue?

@patnaikshekhar
Copy link
Contributor Author

I have no idea how that happened!

@zroubalik zroubalik added this to the v2.0 milestone May 28, 2020
@zroubalik zroubalik changed the title Support adding Standard Metrics to Scaled Object Spec Support adding HPA Standard Metrics to Scaled Object Spec May 28, 2020
@jeffhollan
Copy link
Member

Chatted about this in standup. @ckuduvalli mentioned that also a scenario he is interested in. This potentially could be combined with the requirement for #802 but makes sense

@zroubalik
Copy link
Member

Fixed by #874

SpiritZhou pushed a commit to SpiritZhou/keda that referenced this issue Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Projects
None yet
Development

No branches or pull requests

3 participants