[stable/redis-ha]: add redis source to restore options
What this PR does / why we need it:
This PR adds support for using a remote Redis instance as a data source for restoration. It utilizes the redis-cli --rdb command to perform the restore operation.
[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]
- [x] DCO signed
- [x] Chart Version bumped
- [x] Variables are documented in the README.md
- [x] Title of the PR starts with chart name (e.g.
[stable/mychartname])
@DandyDeveloper
@hawwwdi Can we work through those inline changes your IDE has updated and undo them for now?
Also, can you provide some logging showing a successful restore operation? Backups testing locally for me is a bit of a nightmare :)
@DandyDeveloper, I have fixed those inline changes and rolled them back. Additionally, I’ve made some changes to the restoration script: it is now only executed for the initial master instance and checks the connectivity of the provided Redis endpoint to prevent getting stuck in a crashLoopBackOff state in case of a pod restart.
example logs of a successful restore operation: restore-redis init container:
k logs -n redis test-redis-ha-server-0 -c restore-redis -f
test-redis.test-restore:6379 (10.105.192.181:6379) open
sending REPLCONF capa eof
sending REPLCONF rdb-only 1
SYNC sent to master, writing 7477632846 bytes to '/data/dump.rdb_'
Transfer finished with success.
'/data/dump.rdb_' -> '/data/dump.rdb'
redis instance:
k exec -it -n redis test-redis-ha-server-0 -- sh -c "echo info | redis-cli | tail -2"
Defaulted container "redis" out of: redis, sentinel, split-brain-fix, redis-exporter, config-init (init), restore-redis (init)
# Keyspace
db1:keys=107713981,expires=0,avg_ttl=0
@DandyDeveloper Could you please review this?
@DandyDeveloper reminder
I'll get it checked and if all good, I'll merge tomorrow!
@hawwwdi I'll approved to get the test run but can you make this a minor rather than a patch? It's a big addition. The versioning should probably reflect this.
@hawwwdi I'll approved to get the test run but can you make this a minor rather than a patch? It's a big addition. The versioning should probably reflect this.
I fixed it.