We got the Kubernetes inner loop from 2–5 minutes back to seconds with Tilt
Chapter 8 of a local-Kubernetes series — the payoff that closes the loop chapter 1 opened. Tilt watches files, rebuilds, deploys, and with Live Update syncs code into a running container in seconds.
Key takeaways
-
The pain, quantified: by hand, every edit is
docker build → push → kubectl rollout restart → wait → check logs— a minute or two each. Ten edits = half an hour gone. -
A Tiltfile is a program, not YAML — it's Starlark (a Python dialect).
tilt upexecutes it top to bottom; edit the Tiltfile and Tilt re-executes it, nothing to restart. -
The three pillars:
docker_build('tag','ctx')(how to build),k8s_yaml('file')(what to deploy),k8s_resource('name', port_forwards=...)(fine-tuning). Tilt matches built images to manifest images by tag and swaps in the fresh build. -
Live Update is the star: instead of rebuild+redeploy, Tilt copies changed files straight into the running container. Steps run in a strict order —
fall_back_on→sync→run→restart_container— and the order can't be broken. -
Two newbie traps:
syncpaths must live inside the samedocker_buildcontext ("if Tilt is watching it, you can sync it");run()can't come beforesync(). Also: the first deploy is always full — Live Update needs a running container. -
Hot reload, two scenarios: (A) framework reloads itself —
uvicorn --reload --reload-dir app,syncis enough; (B) no reload — use therestart_processextension (docker_build_with_restart), the modern replacement for the deprecatedrestart_container()on k8s. -
Dashboard at
localhost:10350: per-resource update + runtime status, logs with filtering, endpoints as links, manual Trigger Update, optionalTRIGGER_MODE_MANUAL. - vs Skaffold/DevSpace: Tilt = UI-first + Starlark + Live Update; Skaffold/DevSpace = CLI-first + YAML. Fair caveat: pick by team taste.
Top comments (0)