feat(lool): add probes

This commit is contained in:
Hugo Renard 2024-07-10 12:03:59 +02:00
parent 272e39ffee
commit 69b2dcf7f9
Signed by: hougo
GPG key ID: 3A285FD470209C59

View file

@ -50,6 +50,13 @@ func (r *LibreOfficeOnlineReconciler) reconcileAppStatfuleSet(ctx context.Contex
sts.Spec.Replicas = &replicas
}
probeHandler := corev1.ProbeHandler{
HTTPGet: &corev1.HTTPGetAction{
Path: "/",
Port: intstr.FromString("http"),
},
}
sts.Spec.ServiceName = lshr.GetResourceName(lool, component)
sts.Spec.Template.Spec.Containers = []corev1.Container{
{
@ -72,6 +79,27 @@ func (r *LibreOfficeOnlineReconciler) reconcileAppStatfuleSet(ctx context.Contex
corev1.ResourceMemory: resource.MustParse("5Gi"),
},
},
StartupProbe: &corev1.Probe{
ProbeHandler: probeHandler,
FailureThreshold: 30,
PeriodSeconds: 3,
},
ReadinessProbe: &corev1.Probe{
ProbeHandler: probeHandler,
InitialDelaySeconds: 0,
PeriodSeconds: 10,
TimeoutSeconds: 30,
SuccessThreshold: 1,
FailureThreshold: 2,
},
LivenessProbe: &corev1.Probe{
ProbeHandler: probeHandler,
InitialDelaySeconds: 0,
PeriodSeconds: 10,
TimeoutSeconds: 30,
SuccessThreshold: 1,
FailureThreshold: 4,
},
Env: []corev1.EnvVar{
{Name: "DICTIONARIES", Value: "fr_FR en_GB en_US"},
{Name: "LANGUAGE", Value: "fr en"},