Redis List scaler with no redis username #6403
-
This is my first time using Keda. I'm trying to scale-out a deployment based on redis list size (celery queue length). I have tried every combination of how to provide the redis password/access key, including from a secret, from an env variable on the target, from authenticationRef to a TriggerAuthentication, and no matter what, the ScaledObject fails to start, giving an authentication error. I am using Keda version 2.11. The redis cache is Azure Cache for Redis v6.0.14 (it is behind SSL, port 6380). I know I can connect to it from pods in this same k8s cluster. Note that there is no username for my Azure Cache for Redis server, and I wonder if the Keda scaler might be attempting to authenticate with password and username even though it should only be passing password? The reason I am wondering about that is the scaler's source code appears to pass keda/pkg/scalers/redis_scaler.go Lines 499 to 505 in 26c3451 That could be on the wrong track. Anyway are a couple different setups and their (slightly different) errors: Using
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I got it working! The fault was mine: When I was base64-encoding the Redis access key, as is required to store in a kubernetes secret that keda reads, I was inadvertently including a newline on the value being encoded. Redis saw the extra newline character in the access key and rejected authentication. This is what I had been doing:
This is the fix: (
And the fact that the keda source code passes |
Beta Was this translation helpful? Give feedback.
I got it working! The fault was mine:
When I was base64-encoding the Redis access key, as is required to store in a kubernetes secret that keda reads, I was inadvertently including a newline on the value being encoded. Redis saw the extra newline character in the access key and rejected authentication.
This is what I had been doing:
This is the fix: (
-n
omits trailing newline)And the fact that the keda source code passes
info.username
to the Go redis client is not a problem, even when there is no username.