kedacore / keda

KEDA is a Kubernetes-based Event Driven Autoscaling component. It provides event driven scale for any container running in Kubernetes
https://keda.sh
Apache License 2.0
8.51k stars 1.07k forks source link

error parsing redis metadata: no address given or host given #905

Closed abdennour closed 3 years ago

abdennour commented 4 years ago

Keda is not able to read Redis metadata ( address OR host+port) even though they are defined clearly in the scaled object.

Expected Behavior

Keda is able to scale in/out the deployment based on Redis list size..

And keda-operator deployment logs are

"error":"error getting scaler for trigger #0: error parsing redis metadata: no address given or host given. Address should be in the format of host:port or you should provide both host and port",

Actual Behavior

Keda is not able at all to read Redis from trigger's metadata

Steps to Reproduce the Problem

  1. Run Keda operator from image docker.io/kedacore/keda:1.4.1
  2. Deploy the ScaledObject :

    apiVersion: keda.k8s.io/v1alpha1
    kind: ScaledObject
    # ....
    spec:
    cooldownPeriod: 30
    maxReplicaCount: 10
    minReplicaCount: 1
    pollingInterval: 15
    scaleTargetRef:
      deploymentName: queue-worker-academy-laravel
    scaleType: deployment
    triggers:
    - metadata:
        databaseIndex: "0"
        enableTLS: "false"
        address: redis-master.apps-system:6379
        listLength: "3"
        listName: queues:default
      type: redis

Specifications

# helm -n kube-system list
NAME    NAMESPACE   REVISION    UPDATED                                 STATUS      CHART                   APP VERSION
keda    kube-system 1           2020-07-01 00:00:48.04236 +0300 +03     deployed    keda-1.4.2              1.4.1     

More

Similar to #560 .. but it is still persistent

dustin-decker commented 4 years ago

Hi @abdennour, I found it very confusing, but address should actually reference the env var that contains the address in the target container... It should not be an address. Can you try that?

abdennour commented 4 years ago

Ah! really ? so if we will haveaddress: REDIS_ADDRESS.. This means REDIS_ADDRESS is an environment variable assigned to pods of the reference deployment . In this case, REDIS_ADDRESS must be defined in queue-worker-academy-laravel. Please correct me if i am mistaken ? Also, what is the right syntax:

eexwhyzee commented 4 years ago

@abdennour yeah that's correct, address: REDIS_ADDRESS should get it done

abdennour commented 4 years ago

thank you @eexwhyzee . I will give it a trial

tomkerkhove commented 4 years ago

Did it fix your issue?

abdennour commented 4 years ago

We will test it !

stale[bot] commented 3 years ago

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] commented 3 years ago

This issue has been automatically closed due to inactivity.