DandyDeveloper / charts

Various helm charts migrated from [helm/stable] due to deprecation
https://dandydeveloper.github.io/charts
Apache License 2.0
157 stars 145 forks source link

[charts/redis-ha] Add a preStop script to trigger a failover before a redis master is terminated #178

Closed adyxax closed 2 years ago

adyxax commented 2 years ago

What this PR does / why we need it:

I noticed that when a redis master gets terminated there is a downtime before a new one gets elected. This behavior can be fixed with a preStop script that checks if the terminating pod is a redis master and triggers a failover before shutting down if that is the case.

Special notes for your reviewer:

Do not hesitate to ask for clarifications or changes. I tried to respect the style of the surrounding code.

Checklist

adyxax commented 2 years ago

@DandyDeveloper : Please review this PR when you have time, thank you!

DandyDeveloper commented 2 years ago

@adyxax Great idea. I like this.

I'll jump on the review later today. One immediate thing. This should be a minor increase. Not a patch increase.

adyxax commented 2 years ago

Thank you, I updated the version to a minor increase.

adyxax commented 2 years ago

@DandyDeveloper : if I can do anything to help with your review do not hesitate to ask.