OT-CONTAINER-KIT / redis-operator

A golang based redis operator that will make/oversee Redis standalone/cluster/replication/sentinel mode setup on top of the Kubernetes.
https://ot-redis-operator.netlify.app/
Apache License 2.0
738 stars 207 forks source link

Authenticating to ACL configured cluster with redis operator #688

Open diffuse opened 8 months ago

diffuse commented 8 months ago

Describe your question

Installing redis-cluster and configuring ACL, e.g.:

acl:
  secret:
    secretName: acl-secret

correctly sets up ACL, but the redis operator fails to authenticate with NOAUTH Authentication required.

When using redis-cli in this state, after successfully authenticating, I get the error message CLUSTERDOWN Hash slot not served when trying SET foo bar. This behavior is not present (everything works) when ACL is disabled.

How can the operator be configured to successfully authenticate to the cluster?

What version of redis-operator are you using?

redis-operator version: v0.15.1 redis-operator helm chart: v0.15.9 redis-cluster version: v7 redis-cluster image: v7.0.12 redis-cluster helm chart: v0.15.10

Additional context

icanttakeitanymore commented 7 months ago

i suppose cli commands with acl enabled in k8sutils/redis.go must pass --user and --pass arguments, but there is no such code in there

diffuse commented 7 months ago

For further clarification, this behavior is present when using either of the following configurations in the ACL for the default user:

The cluster comes up successfully with the below config, or when the user default line is omitted entirely:

Which seems to further indicate that the password for the default user just needs to be provided to the operator.

Adding the default user's password to the redis-secret also doesn't expose it to the operator.


With this behavior it seems like using an ACL doesn't provide much benefit, since the default user must be given high level permissions without a password for the operator to work. Is there a known way around this with configuration?

Thanks!