Skip to content

Model server: Startup probe failed … connection refused

AItested on kind v0.33.0, llama.cpp server-b11515

A model server needs time after starting to load its model. Until it answers on its port, the startup probe reports connection refused. That is intended – as long as the probe allows enough time.

Symptom

kubectl -n ki-models get events --field-selector reason=Unhealthy \
  -o custom-columns=ZEIT:.lastTimestamp,MELDUNG:.message
ZEIT                   MELDUNG
2026-10-09T21:30:12Z   Startup probe failed: Get "http://10.244.1.7:8080/health":
                       dial tcp 10.244.1.7:8080: connect: connection refused

In the course the llama.cpp server is still loading its model. Shortly afterwards the rollout succeeds anyway.

Diagnosis

The rollout shows whether the pod becomes ready in the end.

kubectl -n ki-models rollout status deployment llamacpp --timeout=600s
deployment "llamacpp" successfully rolled out

Causes

connection refusedThe server is still loading the model

The port only opens once the model is in memory. Until then every probe fails – the startup probe counts these failures.

failureThresholdToo little time for large models

Slow networks or larger models need more than ten minutes. Kubernetes then restarts the pod and the download starts over.

Fix

For large models raise the startup probe's failureThreshold or preload the model into the cache with an init container.
kubectl -n ki-models patch deployment llamacpp --patch-file ~/ki-lab/tag02/probes.yaml
kubectl -n ki-models rollout status deployment llamacpp --timeout=600s

Don't: Put a liveness probe on the model server without a startup probe – it kills the pod before the model is loaded.

▶
Break it yourself and find it – free
LLMs on Kubernetes hands-on, Day 2: the first model with llama.cpp, probes, resources and throughput.
Go to day 2 →

FAQ

What separates startup, readiness and liveness probes?

Startup asks “is the model loaded?”, readiness “may traffic come?”, liveness “is the server stuck?”. The other two only begin after the startup probe succeeds.

How much time does the probe allow in the course?

60 attempts 10 seconds apart – ten minutes until a restart.

Related error patterns

More