Deploy a worker and wait for readiness
Separate image pull, weight loading and server warmup. A process can accept TCP connections before its model is ready.
Before you start
The streaming mock, Docker and a local Kubernetes context. Use the mock image on CPU; keep GPU requests in a separate manifest.
Read and predict 1 hour including video
Inference Engineering · §7.1–7.1.1 pp. 179–182; §7.2.2 pp. 188–190
Use the printed page numbers. In the supplied PDF, add two to reach the viewer page. Write a prediction for the question below before opening its answer.
Kubernetes · GPU scheduling · Kubernetes · pod probes · Baseten · Inference Engineering
Build and test 3 hours
Write gateway and worker Deployments and Services. Exercise the mock on a local cluster; put the GPU limit and node selector in a separate worker manifest.
Deploy the mock
On a local Kubernetes cluster, create one Deployment for the existing mock image and a Service that selects its pod labels.
Place this Dockerfile beside mock_worker.py. Build with
docker build -t mock-worker:lab .. For a kind cluster runkind load docker-image mock-worker:lab. Use imagePullPolicy: IfNotPresent and HTTP readiness at /ready on port 8001. For the delay drill, add a startup timer to /ready so it returns 503 for the first 15 seconds.FROM python:3.12-slim WORKDIR /app COPY mock_worker.py . CMD ["python", "mock_worker.py", "8001", "0.1"]
Watch readiness
Make the worker wait 15 seconds before reporting ready. Use kubectl get pods -w to watch Running change to Ready.
Describe placement
In a separate manifest place the resource key nvidia.com/gpu under resources.limits with a value of 1. Inspect kubectl describe pod for a Pending GPU worker.
Troubleshooting
If the Service has no endpoints, compare its selector to the pod labels, then check readiness.
Save your result 1 hour
Save a Deployment, Service and readiness probe plus a timeline from pod creation to first successful request.
Explain from memory 1 hour
What happens to a pod that fails readiness while liveness stays healthy?
Check your reasoning
It can keep running while the Service removes it from ready endpoints. A readiness failure alone does not trigger a restart.
Explain Pending versus Running-but-unready. Capture pod events and a readiness transition.