From c0785becf73aeef804afeef90c362a16ff522812 Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Thu, 14 Dec 2023 10:00:50 +0100 Subject: [PATCH] Change initialDelay of startupProbe to the failureThreshold It seems that 30 seconds which were set before was not enough to generate SSL certificate and start osp-httpd container in the POD. Problem was visible for example when this was deployed locally on dev machine. To avoid that problem, and don't need to wait for livenessProbe to start for too long time, this patch removes initialDelay parameter of the startupProbe and instead sets: failureThreshold: 12 periodSeconds: 10 That way startupProbe can fail 12 times before container will be restarted. But checks will be performed every 10 seconds and first successful check will stop startupProbe and start livenessProbe. As livenessProbe will be always started after successful check of the startupProbe we don't need initialDelay there at all so it's removed also. --- pkg/openstackprovisionserver/deployment.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pkg/openstackprovisionserver/deployment.go b/pkg/openstackprovisionserver/deployment.go index b4d2c54..cff8fef 100644 --- a/pkg/openstackprovisionserver/deployment.go +++ b/pkg/openstackprovisionserver/deployment.go @@ -41,15 +41,14 @@ func Deployment( startupProbe := &corev1.Probe{ // TODO might need tuning - TimeoutSeconds: 5, - PeriodSeconds: 3, - InitialDelaySeconds: 30, + TimeoutSeconds: 5, + PeriodSeconds: 10, + FailureThreshold: 12, } livenessProbe := &corev1.Probe{ // TODO might need tuning - TimeoutSeconds: 5, - PeriodSeconds: 3, - InitialDelaySeconds: 3, + TimeoutSeconds: 5, + PeriodSeconds: 3, } readinessProbe := &corev1.Probe{ // TODO might need tuning