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

question: enabling redis auth #201

Closed
lummie opened this issue Nov 13, 2019 · 1 comment · Fixed by #204
Closed

question: enabling redis auth #201

lummie opened this issue Nov 13, 2019 · 1 comment · Fixed by #204

Comments

@lummie
Copy link

lummie commented Nov 13, 2019

Expected behaviour

What do you want to achieve?
Enable redis auth and connect from a client

Actual behaviour

Client returns: ERR Client sent AUTH, but no password is set

Steps to reproduce the behaviour

Following the example from the readme section : Enabling redis auth

echo -n "pass" > password
kubectl create secret generic redis-auth --from-file=password

## example config
apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
  name: redisfailover
spec:
  sentinel:
    replicas: 3
  redis:
    replicas: 1
  auth:
    secretPath: secret

The above example creates a secret called redis-auth with a key of password and the value set to the password.

What I don't understand is the relationship between secretPath and it's value of secret.
Should this actually be redis-auth?
If the operator is hardcoded to use the secret name redis-auth does that then mean I cannot have two instances of the operator running with different authentication?

Any clarification would be good.

@lummie lummie changed the title enabling redis auth question: enabling redis auth Nov 14, 2019
@ese ese pinned this issue Nov 14, 2019
@ese ese unpinned this issue Nov 14, 2019
@shonge
Copy link
Contributor

shonge commented Nov 25, 2019

The redis-operator isn't hardcoded, IIRC:

// GetRedisPassword retreives password from kubernetes secret or, if
// unspecified, returns a blank string
func GetRedisPassword(s Services, rf *redisfailoverv1.RedisFailover) (string, error) {
if rf.Spec.Auth.SecretPath == "" {
// no auth settings specified, return blank password
return "", nil
}
secret, err := s.GetSecret(rf.ObjectMeta.Namespace, rf.Spec.Auth.SecretPath)
if err != nil {
return "", err
}
if password, ok := secret.Data["password"]; ok {
return string(password), nil
}
return "", fmt.Errorf("secret \"%s\" does not have a password field", rf.Spec.Auth.SecretPath)
}

@ese ese closed this as completed in #204 Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants