Skip to content

Commit 4a45e7a

Browse files
Merge pull request #123 from umago/ogx-health
Use HTTP health check for llama-stack/ogx container
2 parents 3cb2a01 + ba001f0 commit 4a45e7a

2 files changed

Lines changed: 35 additions & 3 deletions

File tree

internal/controller/constants.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,14 @@ const (
7676
LCoreConfigMountPath = "/app-root/lightspeed-stack.yaml"
7777
LCoreUserDataMountPath = "/tmp/data"
7878
ForceReloadAnnotationKey = "ols.openshift.io/force-reload"
79+
// Health probe settings for the llama-stack/OGX container.
80+
// The startup probe allows up to 30 failures (300s) for the slow initialization,
81+
// while liveness and readiness probes use a tighter threshold of 3 failures.
82+
LlamaStackHealthPath = "/v1/health"
83+
LlamaStackProbePeriodSeconds = int32(10)
84+
LlamaStackProbeTimeoutSeconds = int32(5)
85+
LlamaStackStartupProbeFailureThreshold = int32(30)
86+
LlamaStackProbeFailureThreshold = int32(3)
7987

8088
// Data Exporter
8189
ExporterConfigVolumeName = "exporter-config"

internal/controller/lcore_deployment.go

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,38 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins
7272
Ports: []corev1.ContainerPort{{Name: "llama-stack", ContainerPort: LlamaStackContainerPort}},
7373
VolumeMounts: llamaStackMounts,
7474
Env: llamaEnvVars,
75+
StartupProbe: &corev1.Probe{
76+
ProbeHandler: corev1.ProbeHandler{
77+
HTTPGet: &corev1.HTTPGetAction{
78+
Path: LlamaStackHealthPath,
79+
Port: intstr.FromInt32(LlamaStackContainerPort),
80+
},
81+
},
82+
PeriodSeconds: LlamaStackProbePeriodSeconds,
83+
TimeoutSeconds: LlamaStackProbeTimeoutSeconds,
84+
FailureThreshold: LlamaStackStartupProbeFailureThreshold,
85+
},
86+
LivenessProbe: &corev1.Probe{
87+
ProbeHandler: corev1.ProbeHandler{
88+
HTTPGet: &corev1.HTTPGetAction{
89+
Path: LlamaStackHealthPath,
90+
Port: intstr.FromInt32(LlamaStackContainerPort),
91+
},
92+
},
93+
PeriodSeconds: LlamaStackProbePeriodSeconds,
94+
TimeoutSeconds: LlamaStackProbeTimeoutSeconds,
95+
FailureThreshold: LlamaStackProbeFailureThreshold,
96+
},
7597
ReadinessProbe: &corev1.Probe{
7698
ProbeHandler: corev1.ProbeHandler{
77-
TCPSocket: &corev1.TCPSocketAction{
99+
HTTPGet: &corev1.HTTPGetAction{
100+
Path: LlamaStackHealthPath,
78101
Port: intstr.FromInt32(LlamaStackContainerPort),
79102
},
80103
},
81-
InitialDelaySeconds: 5,
82-
PeriodSeconds: 10,
104+
PeriodSeconds: LlamaStackProbePeriodSeconds,
105+
TimeoutSeconds: LlamaStackProbeTimeoutSeconds,
106+
FailureThreshold: LlamaStackProbeFailureThreshold,
83107
},
84108
Resources: corev1.ResourceRequirements{
85109
Requests: corev1.ResourceList{

0 commit comments

Comments
 (0)