From 156474af5b63f267d7d863fe8b6c95f7b5d07ef3 Mon Sep 17 00:00:00 2001 From: Zeyad Kenawi Date: Fri, 20 Jan 2023 21:07:59 +0200 Subject: [PATCH 1/4] fix: sentinel readiness probe to fail when master is localhost --- operator/redisfailover/service/generator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index 3a98d8fa6..9ac1aff3d 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -517,6 +517,7 @@ func generateSentinelDeployment(rf *redisfailoverv1.RedisFailover, labels map[st }, VolumeMounts: volumeMounts, Command: sentinelCommand, + // Readiness Probe fails when sentinel is monitoring localhost as master ReadinessProbe: &corev1.Probe{ InitialDelaySeconds: graceTime, TimeoutSeconds: 5, @@ -525,7 +526,7 @@ func generateSentinelDeployment(rf *redisfailoverv1.RedisFailover, labels map[st Command: []string{ "sh", "-c", - "redis-cli -h $(hostname) -p 26379 ping", + "redis-cli -h $(hostname) -p 26379 sentinel get-master-addr-by-name mymaster | head -n 1 | grep -vq '127.0.0.1'", }, }, }, From 6850cac72a6cd2f541eb4427b2a2ef1f4174906c Mon Sep 17 00:00:00 2001 From: Zeyad Kenawi Date: Fri, 20 Jan 2023 21:11:01 +0200 Subject: [PATCH 2/4] fix: weird indentation on comment after pushing. --- operator/redisfailover/service/generator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator.go b/operator/redisfailover/service/generator.go index 9ac1aff3d..887b2afef 100644 --- a/operator/redisfailover/service/generator.go +++ b/operator/redisfailover/service/generator.go @@ -517,7 +517,7 @@ func generateSentinelDeployment(rf *redisfailoverv1.RedisFailover, labels map[st }, VolumeMounts: volumeMounts, Command: sentinelCommand, - // Readiness Probe fails when sentinel is monitoring localhost as master + // Readiness Probe fails when sentinel is monitoring localhost as master ReadinessProbe: &corev1.Probe{ InitialDelaySeconds: graceTime, TimeoutSeconds: 5, From 2c5338a99668992967f2d54c113ca54acd54d51f Mon Sep 17 00:00:00 2001 From: Sergio Ballesteros Date: Thu, 20 Apr 2023 10:47:57 +0200 Subject: [PATCH 3/4] Sentinel readinessprobe default test --- operator/redisfailover/service/generator_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/operator/redisfailover/service/generator_test.go b/operator/redisfailover/service/generator_test.go index 45bd85254..7cfa1546a 100644 --- a/operator/redisfailover/service/generator_test.go +++ b/operator/redisfailover/service/generator_test.go @@ -2158,7 +2158,7 @@ func TestSentinelCustomReadinessProbe(t *testing.T) { Command: []string{ "sh", "-c", - "redis-cli -h $(hostname) -p 26379 ping", + "redis-cli -h $(hostname) -p 26379 sentinel get-master-addr-by-name mymaster | head -n 1 | grep -vq '127.0.0.1'", }, }, }, From ccbdde36564484190e21f007e6b7c060f74fb6bb Mon Sep 17 00:00:00 2001 From: Sergio Ballesteros Date: Thu, 20 Apr 2023 10:57:44 +0200 Subject: [PATCH 4/4] Bump chart version --- charts/redisoperator/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/redisoperator/Chart.yaml b/charts/redisoperator/Chart.yaml index a22af3c82..57d1003ef 100644 --- a/charts/redisoperator/Chart.yaml +++ b/charts/redisoperator/Chart.yaml @@ -4,7 +4,7 @@ appVersion: 1.2.4 apiVersion: v1 description: A Helm chart for the Spotahome Redis Operator name: redis-operator -version: 3.2.7 +version: 3.2.8 home: https://github.com/spotahome/redis-operator keywords: - "golang"