From 18c4a8b534e070b7b952e4b4580368daafc407a4 Mon Sep 17 00:00:00 2001 From: Ce Gao Date: Sun, 29 Sep 2019 03:01:38 -0500 Subject: [PATCH] fix: Update liveness probe to avoid problems (#833) Signed-off-by: Ce Gao --- .../suggestion/composer/composer.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkg/controller.v1alpha3/suggestion/composer/composer.go b/pkg/controller.v1alpha3/suggestion/composer/composer.go index 81ff5740a8e..108996f6420 100644 --- a/pkg/controller.v1alpha3/suggestion/composer/composer.go +++ b/pkg/controller.v1alpha3/suggestion/composer/composer.go @@ -22,7 +22,9 @@ import ( const ( defaultInitialDelaySeconds = 10 - defaultPeriod = 10 + defaultPeriodForReady = 10 + defaultPeriodForLive = 120 + defaultFailureThreshold = 12 // Ref https://github.com/grpc-ecosystem/grpc-health-probe/ defaultGRPCHealthCheckProbe = "/bin/grpc_health_probe" ) @@ -134,7 +136,7 @@ func (g *General) desiredContainer(s *suggestionsv1alpha3.Suggestion) (*corev1.C }, }, InitialDelaySeconds: defaultInitialDelaySeconds, - PeriodSeconds: defaultPeriod, + PeriodSeconds: defaultPeriodForReady, } c.LivenessProbe = &corev1.Probe{ Handler: corev1.Handler{ @@ -146,8 +148,10 @@ func (g *General) desiredContainer(s *suggestionsv1alpha3.Suggestion) (*corev1.C }, }, }, + // Ref https://srcco.de/posts/kubernetes-liveness-probes-are-dangerous.html InitialDelaySeconds: defaultInitialDelaySeconds, - PeriodSeconds: defaultPeriod, + PeriodSeconds: defaultPeriodForLive, + FailureThreshold: defaultFailureThreshold, } return c, nil }