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

ScaledObject is not created #1030

Closed
hovhannescognaize opened this issue May 17, 2024 · 8 comments
Closed

ScaledObject is not created #1030

hovhannescognaize opened this issue May 17, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@hovhannescognaize
Copy link

hovhannescognaize commented May 17, 2024

Report

Hi team, I am trying to use this to automatically scale my workloads when there is request coming to pod. I have configured 0.8.0 version of Keda http add-on.

Expected Behavior

Scale when there are requests. ScaledObject should've created.

Actual Behavior

Nothing happening, ScaledObject not created

Steps to Reproduce the Problem

Logs from KEDA HTTP operator

there isn't any valid interceptor endpoint

HTTP Add-on Version

0.8.0

Kubernetes Version

1.29

Platform

Google Cloud

Anything else?

No response

@hovhannescognaize hovhannescognaize added the bug Something isn't working label May 17, 2024
@JorTurFer
Copy link
Member

Hello,
Could you share your HTTPScaledObject and the add-on operator logs?

@hovhannescognaize
Copy link
Author

hovhannescognaize commented May 18, 2024

Yes, this is my config for httpscaledobject:

kind: HTTPScaledObject
apiVersion: http.keda.sh/v1alpha1
metadata:
    name: cognaize-txt-service
    annotations:
        httpscaledobject.keda.sh/skip-scaledobject-creation: "false"
spec:
    hosts:
    - examplesmth.net
    scaleTargetRef:
        name: sda
        kind: Deployment
        apiVersion: apps/v1
        service: sda
        port: 80
    replicas:
        min: 1
        max: 10
    scaledownPeriod: 300
    scalingMetric: # requestRate and concurrency are mutually exclusive
        requestRate:
            granularity: 1s
            targetValue: 100
            window: 1m
        concurrency:
            targetValue: 100

And this is logs for external scaler:

2024-05-17T18:56:37Z	INFO	Scaler Version: 0.8.0
2024-05-17T18:56:37Z	INFO	setup	starting the grpc server
2024-05-17T18:56:37Z	INFO	setup	starting the queue pinger
2024-05-17T18:56:37Z	INFO	setup	starting the httpso informer
2024-05-17T18:56:37Z	INFO	setup	starting the endpoints informer
2024-05-17T18:56:37Z	INFO	starting grpc server	{"address": "0.0.0.0:9090"}
2024-05-17T18:56:37Z	INFO	starting healthchecks loop
2024-05-17T18:56:37Z	INFO	Scaler Commit: 1c9f7348b8d481ae044f2ec58627cba1ce859b8c
2024-05-17T18:56:37Z	INFO	Go Version: go1.22.2
2024-05-17T18:56:37Z	INFO	Go OS/Arch: linux/amd64

Logs of keda operator:

2024/05/17 18:51:20 maxprocs: Updating GOMAXPROCS=1: determined from CPU quota
2024-05-17T18:51:21Z	INFO	setup	Starting manager
2024-05-17T18:51:21Z	INFO	setup	KEDA Version: 2.14.0
2024-05-17T18:51:21Z	INFO	setup	Git Commit: 6681d5ecbc82293626cab693625c9cc9fb453381
2024-05-17T18:51:21Z	INFO	setup	Go Version: go1.21.9
2024-05-17T18:51:21Z	INFO	setup	Go OS/Arch: linux/amd64
2024-05-17T18:51:21Z	INFO	setup	Running on Kubernetes 1.28	{"version": "v1.28.7-gke.1026000"}
2024-05-17T18:51:21Z	INFO	starting server	{"kind": "health probe", "addr": "[::]:8081"}
I0517 18:51:21.163194       1 leaderelection.go:250] attempting to acquire leader lease keda/operator.keda.sh...
I0517 18:51:57.078259       1 leaderelection.go:260] successfully acquired lease keda/operator.keda.sh
2024-05-17T18:51:57Z	INFO	Starting EventSource	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "source": "kind source: *v1alpha1.ScaledObject"}
2024-05-17T18:51:57Z	INFO	Starting EventSource	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject", "source": "kind source: *v2.HorizontalPodAutoscaler"}
2024-05-17T18:51:57Z	INFO	Starting Controller	{"controller": "scaledobject", "controllerGroup": "keda.sh", "controllerKind": "ScaledObject"}
2024-05-17T18:51:57Z	INFO	Starting EventSource	{"controller": "triggerauthentication", "controllerGroup": "keda.sh", "controllerKind": "TriggerAuthentication", "source": "kind source: *v1alpha1.TriggerAuthentication"}
2024-05-17T18:51:57Z	INFO	Starting Controller	{"controller": "triggerauthentication", "controllerGroup": "keda.sh", "controllerKind": "TriggerAuthentication"}
2024-05-17T18:51:57Z	INFO	Starting EventSource	{"controller": "scaledjob", "controllerGroup": "keda.sh", "controllerKind": "ScaledJob", "source": "kind source: *v1alpha1.ScaledJob"}
2024-05-17T18:51:57Z	INFO	Starting Controller	{"controller": "scaledjob", "controllerGroup": "keda.sh", "controllerKind": "ScaledJob"}

@JorTurFer
Copy link
Member

JorTurFer commented May 18, 2024

I need the logs of the add-on operator (HTTP Add-on operator), not KEDA operator logs (there are 2 operators, KEDA's one and the Add-on one).
I expect errors on the add-on logs because the HTTPScaledObject is defining both, requestRate and concurrency, and they are mutually exclusive:

      scalingMetric: # requestRate and concurrency are mutually exclusive
        requestRate:
            granularity: 1s
            targetValue: 100
            window: 1m
        concurrency:
            targetValue: 100

@hovhannescognaize
Copy link
Author

Thank you very much, I didn't had a close look at that part that it should be only one either requestRate or concurrency.

One question just, I want to scale based on request count so every time when there is request I want to trigger pod scale up, will this configuration work at that way?

scalingMetric: # requestRate and concurrency are mutually exclusive
        concurrency:
            targetValue: 1

@JorTurFer
Copy link
Member

JorTurFer commented May 19, 2024

If you don't have a continuous amount of traffic (> 1-2krmp), I'd use requestRate:

      scalingMetric:
        requestRate:
            granularity: 1s
            targetValue: 100 # 100 request per second
            window: 1m

@hovhannescognaize
Copy link
Author

hovhannescognaize commented May 19, 2024

When I have changed from this:

scalingMetric:
     concurrency:
          targetValue: 1

to this:

scalingMetric:
    requestRate:
        granularity: 1s
        targetValue: 1 # 1 request per second
        window: 1m

It didn't created new ScaledObject, is that expected?

@JorTurFer
Copy link
Member

JorTurFer commented May 19, 2024

The ScaledObject doesn't change due to this change because in v0.8.0 we introduced a change in how both items are connected, instead of updating the ScaledObject with more new info, we just reference the HTTPScaledObject in the ScaledObject (if you check the metadata section, the only fields are the external scaler address and the HTTPScaledObject name).

All the changes are applied on the add-on components side (but you should still have the ScaledObject created before)

@hovhannescognaize
Copy link
Author

Got it, thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

2 participants