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

Keda-Operator : ScaledObject doesn't have correct scaleTargetRef specification although my specifications are correct #4975

Closed
kherath17 opened this issue Sep 13, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@kherath17
Copy link

A clear and concise description of what the bug is.
In a Kubernetes cluster I have created deployment each for Selenium-Hub and Chrome , and the respective services are also created and currently my tests are running on this setup. I wanted to auto-scale the pods depending on the session que requests and I used Keda - Selenium-Grid for that , but unfortunately Im running into an issue which says ScaledObject doesn't have correct scaleTargetRef specification , all the objects such as scaled objects , pods are on the same namespace

Expected Behavior

Scaled Object should create without Issue

Actual Behavior

Shows ScaledObject doesn't have correct scaleTargetRef specification by Keda-Operator

image

My .yaml files are as below

apiVersion: keda.sh/v1alpha1 kind: ScaledObject metadata: name: selenium-scaledobject namespace: default labels: deploymentName: selenium-chrome-node spec: scaleTargetRef: name: selenium-chrome-node minReplicaCount: 0 maxReplicaCount: 80 pollingInterval: 50 triggers: - type: selenium-grid metadata: url: 'http://selenium-hub-service:80/graphql' browserName: 'chrome'

image

PS - the url in the metadata section is the url of the hub service that I have created in my cluster and its respective port

Steps to Reproduce the Problem

1.Make 2 deployments in a Kubernetes cluster for Hub and the Node
2.Create the respective services to be access locally (Port Forwarding)
3.Setup the ScaledObject as described above pointing to the Chrome Node Deployment

Specifications

  • KEDA Version: Keda 2.11.2
  • Platform & Version: Windows 10 X64
  • Kubernetes Version: v1.24.16-eks-2d98532
  • Scaler(s): Keda - ScaledObject
@kherath17 kherath17 added the bug Something isn't working label Sep 13, 2023
@JorTurFer
Copy link
Member

I move this issue to KEDA repo because it's not related with the helm chart

@JorTurFer JorTurFer transferred this issue from kedacore/charts Sep 14, 2023
@JorTurFer
Copy link
Member

Could you share KEDA operator logs? It looks like the deployment doesn't exist, but I think that we will see a more clear message in KEDA operator logs

@kherath17
Copy link
Author

@JorTurFer I have missed to add the name: selenium-node-chrome which is mentioned under scaletargetref spec in my chrome deployment labels, this is working now

@github-project-automation github-project-automation bot moved this from To Triage to Ready To Ship in Roadmap - KEDA Core Sep 22, 2023
@kumarnaveentulasi
Copy link

Hello can u help me i was facing the same issue the issue was as follows

Type Reason Age From Message


Warning ScaledObjectCheckFailed 47m (x9 over 47m) keda-operator Target resource doesn't exist
Warning ScaledObjectCheckFailed 47m (x9 over 47m) keda-operator ScaledObject doesn't have correct scaleTargetRef specification
Normal KEDAScalersStarted 47m keda-operator Started scalers watch
Normal ScaledObjectReady 47m (x3 over 47m) keda-operator ScaledObject is ready for scaling
Warning KEDAScalerFailed 47m keda-operator error inspecting rabbitMQ: Exception (404) Reason: "NOT_FOUND - no queue 'inference_queue' in vhost '/'"
Normal KEDAScalersStarted 2m31s (x719 over 47m) keda-operator Scaler rabbitmq is built.

but my hpa was as follows

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: my-microservice-scaledobject
namespace: dev
spec:
scaleTargetRef:
name: my-microservice # The name of your deployment
pollingInterval: 5 # Time interval to poll RabbitMQ queue for messages
cooldownPeriod: 30 # Time to wait before scaling down after scaling up
minReplicaCount: 0 # Minimum replicas can scale to 0
maxReplicaCount: 20 # Maximum replicas (adjust based on your needs)
triggers:

  • type: rabbitmq
    metadata:
    host: "amqp://admin:Truefan@[email protected]:5672" # Correct RabbitMQ URL
    queueName: "inference_queue" # The RabbitMQ queue name to monitor
    vhost: "naveen-test-dev" # The vhost name (ensure this is the correct vhost in RabbitMQ)
    queueLength: "1" # Scale 1 pod per message in the queue

i was the file name as hpa.yml and the deploying in the dev namespace and keda operator in the keda namespace can any help me with this

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
Archived in project
Development

No branches or pull requests

3 participants