serving icon indicating copy to clipboard operation
serving copied to clipboard

Support HPA creation with multiple metrics

Open rachitchauhan43 opened this issue 2 years ago • 6 comments

Describe the feature

Since k8s 1.23, HPA supports scaling on multiple metrics. Can this support be added to knative autoscaler-hpa as well ? https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#scaling-on-multiple-metrics

Slack thread for context: https://cloud-native.slack.com/archives/C04LGHDR9K7/p1679561219442129

rachitchauhan43 avatar Jul 07 '23 16:07 rachitchauhan43

I feel like this is a valid thing to have. We plan do to something similar here for internal components.

/triage accepted

ReToCode avatar Aug 04 '23 06:08 ReToCode

Is there any action item now ? I'd love to contribute this feature. @ReToCode

anencore94 avatar May 22 '25 05:05 anencore94

@anencore94 can you elaborate on your use case a bit more?

dprotaso avatar Jun 17 '25 01:06 dprotaso

@anencore94 can you elaborate on your use case a bit more?

Hi, @dprotaso . Same as the description in the slack thread. I'd like to create and operating my knative service's autoscaling with hpa object (which was created by knative-controller), with two or more different metrics. As far as I know, I could specify only single metric for hpa when operating knative servcie by annotations like autoscaling.knative.dev/class: "hpa.autoscaling.knative.dev", autoscaling.knative.dev/metric: "memory"

anencore94 avatar Jun 18 '25 01:06 anencore94

with two or more different metrics.

Which metrics are you wanting to scale on?

dprotaso avatar Jun 18 '25 16:06 dprotaso

with two or more different metrics.

Which metrics are you wanting to scale on?

I'd like to scale on cpu and memory both. For example, if cpu > 70 % or memory > 70 %.

anencore94 avatar Jun 20 '25 06:06 anencore94