http-add-on icon indicating copy to clipboard operation
http-add-on copied to clipboard

HTTP Add-on not working with other scalers or when scaled object is created separately

Open utsav-simplismart opened this issue 1 year ago • 2 comments

Report

Http Add-on standalone is working fine. But when creating a separate scaledobject with httpscaledobject defined as external push trigger, it is not working.

Expected Behavior

It should scale even if the scaledobject is created separately with an external push trigger to the HTTPscaledobject.

Actual Behavior

When using httpscaledobject with below annotation and with minimum replica as 0, it is working fine. It is scaling from 0 to 1 when new request comes in.

annotations:
    httpscaledobject.keda.sh/skip-scaledobject-creation: 'false'

But when creating httpscaledobject with annotation set to true and with minimum replica as 0, it is not working even after creating a separate ScaledObject.

annotations:
    httpscaledobject.keda.sh/skip-scaledobject-creation: 'true'

The trigger in scaledobject looks like this:

triggers:
    - metadata:
        httpScaledObject: cognizant-keda-http-scaledobject # name of HTTPScaledObject
        scalerAddress: 'keda-add-ons-http-external-scaler.keda:9090'
      type: external-push

Steps to Reproduce the Problem

  1. Create a HTTPScaledObject with below annotation with minimum replica as 0:
annotations:
    httpscaledobject.keda.sh/skip-scaledobject-creation: 'true'
  1. Create a separate Scaledobject with trigger as below with minimum replica as 0:
triggers:
   - metadata:
       httpScaledObject: cognizant-keda-http-scaledobject # name of HTTPScaledObject
       scalerAddress: 'keda-add-ons-http-external-scaler.keda:9090'
     type: external-push
  1. Send a request to target deployment/service.

Logs from KEDA HTTP operator

example

HTTP Add-on Version

0.8.0

Kubernetes Version

None

Platform

Amazon Web Services

Anything else?

No response

utsav-simplismart avatar Jul 04 '24 11:07 utsav-simplismart

I had a similar issue. What worked for me was naming the ScaledObject the same as the HttpScaledObject

thomasfroehle avatar Aug 16 '24 11:08 thomasfroehle

I think this is the problem: https://github.com/kedacore/http-add-on/blob/08c811fe205daaf2bc55c6a46155be2729f21916/scaler/handlers.go#L221-L222 It should probably be using the httpScaledObjectName specified by the scalerMetadata, rather than the name of the ScaledObject ref

nyobe avatar Sep 29 '24 17:09 nyobe

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] avatar Dec 01 '24 22:12 stale[bot]

This issue has been automatically closed due to inactivity.

stale[bot] avatar Dec 10 '24 04:12 stale[bot]