- A user terminal generating a steady heartbeat of requests.
- An operator terminal performing the rollout.
- Prometheus as a witness that watches readiness and capacity.
1) Users: a steady heartbeat of requests
On the user terminal we run a simple loop that sends one request per second and prints the request sequence number and HTTP status. A continuous column of200s is the heartbeat; any non-200 shows up immediately.
2) Operator: rolling the deployment
On the operator terminal we locate thedecode-role deployment in the namespace, trigger a rollout (here simulated by setting an environment variable), and then watch pods as Kubernetes performs the rolling update.
Setting or changing an environment variable is a safe stand‑in for a real trigger (for example, a new image tag or server version). Kubernetes treats this as a pod spec change and performs the same rolling replacement sequence.
- A new pod appears and typically moves Pending → ContainerCreating → Running, but its readiness probe will initially report “not ready”.
- While not Ready the pod does not receive traffic — it may be pulling model weights and initializing.
- Once the readiness probe passes, the pod flips to Ready and joins the inference pool.
- Only after the replacement is Ready does an old pod begin Terminating, drain in‑flight work, and exit.
3) Prometheus: verifying ready endpoints
From Prometheus we can inspect what the router sees for ready endpoints. The metric below shows how many ready endpoints the router sees for thequickstart-epp service:
0. The rollout strategy ensures the system never reduces available capacity before a replacement is ready.
Observing the user stream during turnover
Back on the user terminal you should continue to see requests succeed:Why this is safe: three cooperating mechanisms
Together these ensure an update happens with no observable interruption: pods ready only when healthy, router only sends traffic to ready endpoints, and the rolling strategy prevents capacity dips. That’s day‑two operations in miniature — queues hold the line, autoscaling and readiness signals are trusted, and change leaves no fingerprints.
Quick command reference
Links and references
- Kubernetes rolling updates: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#rolling-update-deployment
- Readiness probes: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/
- Prometheus: https://prometheus.io/
A quick tip: run the user heartbeat and the operator rollout in separate terminals to see the real‑time effect. Use Prometheus or your router’s metrics to validate that ready endpoint counts never drop to zero.