From ba001f00edbcf750c685cbdd46731047dd93fab3 Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Wed, 24 Jun 2026 15:08:29 +0100 Subject: [PATCH] Use HTTP health check for llama-stack/ogx container Replace the TCP socket readiness probe with a proper HTTP GET on /v1/health. Also, add a startup probe and liveness probe that will start only after the startup one succeeds. Signed-off-by: Lucas Alvares Gomes --- internal/controller/constants.go | 8 +++++++ internal/controller/lcore_deployment.go | 30 ++++++++++++++++++++++--- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/internal/controller/constants.go b/internal/controller/constants.go index 70458cc..bfc3460 100644 --- a/internal/controller/constants.go +++ b/internal/controller/constants.go @@ -76,6 +76,14 @@ const ( LCoreConfigMountPath = "/app-root/lightspeed-stack.yaml" LCoreUserDataMountPath = "/tmp/data" ForceReloadAnnotationKey = "ols.openshift.io/force-reload" + // Health probe settings for the llama-stack/OGX container. + // The startup probe allows up to 30 failures (300s) for the slow initialization, + // while liveness and readiness probes use a tighter threshold of 3 failures. + LlamaStackHealthPath = "/v1/health" + LlamaStackProbePeriodSeconds = int32(10) + LlamaStackProbeTimeoutSeconds = int32(5) + LlamaStackStartupProbeFailureThreshold = int32(30) + LlamaStackProbeFailureThreshold = int32(3) // Data Exporter ExporterConfigVolumeName = "exporter-config" diff --git a/internal/controller/lcore_deployment.go b/internal/controller/lcore_deployment.go index 69a9957..8aa5781 100644 --- a/internal/controller/lcore_deployment.go +++ b/internal/controller/lcore_deployment.go @@ -72,14 +72,38 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins Ports: []corev1.ContainerPort{{Name: "llama-stack", ContainerPort: LlamaStackContainerPort}}, VolumeMounts: llamaStackMounts, Env: llamaEnvVars, + StartupProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: LlamaStackHealthPath, + Port: intstr.FromInt32(LlamaStackContainerPort), + }, + }, + PeriodSeconds: LlamaStackProbePeriodSeconds, + TimeoutSeconds: LlamaStackProbeTimeoutSeconds, + FailureThreshold: LlamaStackStartupProbeFailureThreshold, + }, + LivenessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + HTTPGet: &corev1.HTTPGetAction{ + Path: LlamaStackHealthPath, + Port: intstr.FromInt32(LlamaStackContainerPort), + }, + }, + PeriodSeconds: LlamaStackProbePeriodSeconds, + TimeoutSeconds: LlamaStackProbeTimeoutSeconds, + FailureThreshold: LlamaStackProbeFailureThreshold, + }, ReadinessProbe: &corev1.Probe{ ProbeHandler: corev1.ProbeHandler{ - TCPSocket: &corev1.TCPSocketAction{ + HTTPGet: &corev1.HTTPGetAction{ + Path: LlamaStackHealthPath, Port: intstr.FromInt32(LlamaStackContainerPort), }, }, - InitialDelaySeconds: 5, - PeriodSeconds: 10, + PeriodSeconds: LlamaStackProbePeriodSeconds, + TimeoutSeconds: LlamaStackProbeTimeoutSeconds, + FailureThreshold: LlamaStackProbeFailureThreshold, }, Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{