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

Redis cluster 7.x.x is not supported by KEDA 2.9.1 #4052

Closed
kubroid opened this issue Dec 30, 2022 · 4 comments · Fixed by #4065
Closed

Redis cluster 7.x.x is not supported by KEDA 2.9.1 #4052

kubroid opened this issue Dec 30, 2022 · 4 comments · Fixed by #4065
Labels
bug Something isn't working

Comments

@kubroid
Copy link

kubroid commented Dec 30, 2022

Report

While trying to use KEDA with redis cluster v7.x.x for scale based on list length:

Spec:
  Advanced:
  Scale Target Ref:
    Name:  serving
  Triggers:
    Metadata:
      Addresses:    ***
      List Length:  3
      List Name:    ***
    Type:           redis-cluster
Status:
  Conditions:
    Message:  Failed to ensure HPA is correctly created for ScaledObject
    Reason:   ScaledObjectCheckFailed
    Status:   False
    Type:     Ready
    Message:  ScaledObject check failed
    Reason:   UnkownState
    Status:   Unknown
    Type:     Active
    Message:  No fallbacks are active on this scaled object
    Reason:   NoFallbackFound
    Status:   False
    Type:     Fallback
  External Metric Names:
    s0-redis-input-queue
  Health:
    s0-redis-input-queue:
      Number Of Failures:  0
      Status:              Happy
  Hpa Name:                keda-hpa-serving
  Last Active Time:        2022-12-23T15:25:25Z
  Original Replica Count:  1
  Scale Target GVKR:
    Group:            apps
    Kind:             Deployment
    Resource:         deployments
    Version:          v1
  Scale Target Kind:  apps/v1.Deployment
Events:
  Type     Reason                   Age                 From           Message
  ----     ------                   ----                ----           -------
  Warning  ScaledObjectCheckFailed  10s (x12 over 14s)  keda-operator  Failed to ensure HPA is correctly created for ScaledObject
  Warning  KEDAScalerFailed         8s (x13 over 14s)   keda-operator  connection to redis cluster failed: got 4 elements in cluster info address, expected 2 or 3

With redis cluster v6.x.x works fine.

Expected Behavior

Work same as for redis v6.x.x

Actual Behavior

ScaledObject failing during initialization:

  Type     Reason                   Age                 From           Message
  ----     ------                   ----                ----           -------
  Warning  ScaledObjectCheckFailed  10s (x12 over 14s)  keda-operator  Failed to ensure HPA is correctly created for ScaledObject
  Warning  KEDAScalerFailed         8s (x13 over 14s)   keda-operator  connection to redis cluster failed: got 4 elements in cluster info address, expected 2 or 3

Steps to Reproduce the Problem

  1. deploy redis cluster v7.0.0
  2. deploy ScaledObject with Type of redis-cluster

Logs from KEDA operator

2022-12-30T11:34:46Z    ERROR    scalehandler    Error getting scalers    {"object": {"apiVersion": "keda.sh/v1alpha1", "kind": "ScaledObject", "namespace": "default", "name": "serving"}, "error": "connection to redis cluster failed: got 4 elements in cluster info address, expected 2 or 3"}                      
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers                                                                                                                                                                                                                                                          
    /workspace/pkg/scaling/scale_handler.go:347                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop                                                                                                                                                                                                                                                        
    /workspace/pkg/scaling/scale_handler.go:162                                                                                                                                                                                                                                                                               
2022-12-30T11:34:51Z    ERROR    scalehandler    error resolving auth params    {"scalerIndex": 0, "object": {"apiVersion": "keda.sh/v1alpha1", "kind": "ScaledObject", "namespace": "default", "name": "serving"}, "error": "connection to redis cluster failed: got 4 elements in cluster info address, expected 2 or 3
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).buildScalers                                                                                                                                                                                                                                                          
    /workspace/pkg/scaling/scale_handler.go:543                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).performGetScalersCache                                                                                                                                                                                                                                                
    /workspace/pkg/scaling/scale_handler.go:269                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).GetScalersCache                                                                                                                                                                                                                                                       
    /workspace/pkg/scaling/scale_handler.go:190                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers                                                                                                                                                                                                                                                          
    /workspace/pkg/scaling/scale_handler.go:345                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop                                                                                                                                                                                                                                                        
    /workspace/pkg/scaling/scale_handler.go:162                                                                                                                                                                                                                                                                               
2022-12-30T11:34:51Z    ERROR    scalehandler    Error getting scalers    {"object": {"apiVersion": "keda.sh/v1alpha1", "kind": "ScaledObject", "namespace": "default", "name": "serving"}, "error": "connection to redis cluster failed: got 4 elements in cluster info address, expected 2 or 3"}                      
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).checkScalers                                                                                                                                                                                                                                                          
    /workspace/pkg/scaling/scale_handler.go:347                                                                                                                                                                                                                                                                               
github.com/kedacore/keda/v2/pkg/scaling.(*scaleHandler).startScaleLoop                                                                                                                                                                                                                                                        
    /workspace/pkg/scaling/scale_handler.go:162                                                                                                                                                                                                                                                                               

KEDA Version

2.9.1

Kubernetes Version

1.24

Platform

Amazon Web Services

Scaler Details

redis-cluster

Anything else?

No response

@kubroid kubroid added the bug Something isn't working label Dec 30, 2022
@kubroid kubroid changed the title Redis 7.x.x is not supported by KEDA 2.9.1 Redis cluster 7.x.x is not supported by KEDA 2.9.1 Dec 30, 2022
@JorTurFer
Copy link
Member

Hi,
If I remember it correctly, something changed in the protocol from v6 to v7 and I guess some changes are required. Are you willing to contribute with them? (we should ensure backward compatibility with other versions)

@JorTurFer
Copy link
Member

Maybe this only applies to redis streams, but just in case

@kubroid
Copy link
Author

kubroid commented Dec 30, 2022

I assume the only change is v8->v9:

If you are using Redis 7, install go-redis/v9:

go get github.com/go-redis/redis/v9

I can help with beta testing on my live environment.

@JorTurFer
Copy link
Member

I'm not totally sure about if v9 works with redis 6, it looks like the client has changes, but we can just give a try.
We can extend redis e2e to check the oldest redis with support and latest

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

Successfully merging a pull request may close this issue.

2 participants