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

Default shutdown.sh cannot reach Sentinel #261

Closed
leejones opened this issue May 4, 2020 · 3 comments
Closed

Default shutdown.sh cannot reach Sentinel #261

leejones opened this issue May 4, 2020 · 3 comments
Labels

Comments

@leejones
Copy link

leejones commented May 4, 2020

Thank you for providing this operator! I ran into an issue that I hope can be resolved.

Expected behaviour

The default shutdown.sh script varies the Sentinel service name based on the name of the RedisFailover.

Actual behaviour

The script expects the Sentinel service name to be rfs-redis so it only works if RedisFailover is named redis. The script won't initiate the failover when the RedisFailover is named anything else.

Steps to reproduce the behaviour

  1. Create a RedisFailover with any name other than redis, for example:
---
apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
  name: redisfailover
spec:
  sentinel:
    replicas: 3
  redis:
    replicas: 2
  1. kubectl exec into a Redis pod and call the shutdown script in the same way that the preStop lifecycle hook calls it:
$> kubectl exec -it rfr-redisfailover-0 -- /bin/sh /redis-shutdown/shutdown.sh
Could not connect to Redis at -p:6379: Name does not resolve
OK
sh: 10.66.10.71: unknown operand

The redis-cli save works since it's using localhost, but the calls to Sentinel fail. The errors are because the Sentinel service ENV vars the script is using are nil, for example:

/data $ echo $RFS_REDIS_SERVICE_HOST
# no output

Environment

  • Redis Operator version: v1.0.0
  • Kubernetes version: v1.15.9
@github-actions
Copy link

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label Jan 14, 2022
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@leejones
Copy link
Author

Fixed by #372.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant