Skip to content

Commit

Permalink
Add startupProbe for Horizon pod
Browse files Browse the repository at this point in the history
The Horizon pod is fairly frequently killed due to the current liveness
probe timing. This seems to happen more frequently during the initial
deployment while the system is under load. This change adds the
startup probe to provide some extra time for kubelet to validate the
functionality of the Horizon pod before terminating it.

Signed-off-by: Brendan Shephard <[email protected]>
  • Loading branch information
bshephar committed Jul 3, 2023
1 parent 0db686a commit e0abf14
Showing 1 changed file with 19 additions and 6 deletions.
25 changes: 19 additions & 6 deletions pkg/horizon/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ func Deployment(instance *horizonv1.Horizon, configHash string, labels map[strin

args := []string{"-c", ServiceCommand}
livenessProbe := &corev1.Probe{
TimeoutSeconds: 5,
PeriodSeconds: 10,
InitialDelaySeconds: 10,
TimeoutSeconds: 15,
PeriodSeconds: 5,
InitialDelaySeconds: 15,
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/dashboard/auth/login/?next=/dashboard/",
Expand All @@ -49,9 +49,21 @@ func Deployment(instance *horizonv1.Horizon, configHash string, labels map[strin
},
}
readinessProbe := &corev1.Probe{
TimeoutSeconds: 5,
PeriodSeconds: 10,
InitialDelaySeconds: 10,
TimeoutSeconds: 25,
PeriodSeconds: 5,
InitialDelaySeconds: 15,
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/dashboard/auth/login/?next=/dashboard/",
Port: intstr.IntOrString{IntVal: 80},
},
},
}

startupProbe := &corev1.Probe{
TimeoutSeconds: 30,
PeriodSeconds: 60,
InitialDelaySeconds: 60,
ProbeHandler: corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/dashboard/auth/login/?next=/dashboard/",
Expand Down Expand Up @@ -101,6 +113,7 @@ func Deployment(instance *horizonv1.Horizon, configHash string, labels map[strin
Resources: instance.Spec.Resources,
ReadinessProbe: readinessProbe,
LivenessProbe: livenessProbe,
StartupProbe: startupProbe,
Ports: []corev1.ContainerPort{
{
Name: "http",
Expand Down

0 comments on commit e0abf14

Please sign in to comment.