diff options
author | Julien Dessaux | 2022-03-14 23:42:53 +0100 |
---|---|---|
committer | Julien Dessaux | 2022-03-14 23:43:35 +0100 |
commit | c019a89188e3501765c1a8bc549cc588f200338e (patch) | |
tree | a5fcc078e3407a301ac15a4e960ce38ac30fa101 | |
parent | Added warbreaker book article (diff) | |
download | www-c019a89188e3501765c1a8bc549cc588f200338e.tar.gz www-c019a89188e3501765c1a8bc549cc588f200338e.tar.bz2 www-c019a89188e3501765c1a8bc549cc588f200338e.zip |
Added redis chart blog article
-rw-r--r-- | content/blog/miscellaneous/redis-chart.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/content/blog/miscellaneous/redis-chart.md b/content/blog/miscellaneous/redis-chart.md new file mode 100644 index 0000000..e9d5103 --- /dev/null +++ b/content/blog/miscellaneous/redis-chart.md @@ -0,0 +1,23 @@ +--- +title: Fixing a redis chart +date: 2022-03-14 +description: I contributed a preStop script to trigger a failover before a redis master is terminated +tags: + - helm + - kubernetes + - redis +--- + +## Introduction + +Back in January I contributed a fix to a redis chart : https://github.com/DandyDeveloper/charts/pull/178. I should have blogged about it at the time, but life happened and I did not. + +## The problem + +This charts deploys a redis cluster and I noticed that when a redis master gets terminated there is a downtime before a new one gets elected. + +One of the challenges in fixing this behaviour was to do it in a way that would get accepted upstream. That meant respecting the style in place to manage the chart : scripts are deployed in the images as configmap values and are written inside a helm template... yummy! This allows to use helm variables easily, and avoids maintaining custom images but made linting or shellcheck validation a pain to do. + +## The solution + +This restart behaviour can be fixed with a preStop script that checks if the terminating pod is a redis master. If that is the case, we trigger a failover before shutting then wait for it to complete. My fix was accepted and merged upstream, I am proud I had the opportunity to contribute back to this chart in the community spirit of open source software. |