Scripts2026年4月15日·1 分钟阅读

Tilt — Multi-Service Development for Kubernetes

Kubernetes dev loop that watches source, rebuilds images, live-updates pods, and shows it all in one dashboard. The standard tool for the 50-microservice laptop problem.

Introduction

Tilt solves the "50 microservices on my laptop" problem. Where Docker Compose stalls and raw kubectl becomes a maintenance nightmare, Tilt turns your Kubernetes manifests into a reactive dev loop — edit a source file, Tilt rebuilds only the affected image, reloads the pod, and streams merged logs to a single UI. It is the standard tool at companies that ship dozens of services into a shared cluster.

What Tilt Does

  • Watches source trees and rebuilds images incrementally with BuildKit or Buildpacks
  • Live-updates running pods via docker cp-style file syncs — no full rebuild needed
  • Aggregates logs, events, and resource status into one web dashboard
  • Automates kubectl apply, helm template, kustomize build, and custom commands
  • Re-runs tests and linters on save with configurable trigger modes

Architecture Overview

Tilt is a Go binary that reads a Tiltfile — a Starlark script exposing build, deploy, and resource primitives. It launches a long-running controller which reconciles the declared state with Kubernetes, watches filesystem changes with fsnotify, and talks to a local container runtime for builds. The web UI is a separate React app served on a local port and updated over a streaming API.

Self-Hosting & Configuration

  • Tiltfile is pure Starlark — loops, functions, and imports work as you expect
  • docker_build supports live_update steps that sync files into a running container
  • Define resource dependencies so backend starts before frontend
  • Works with kind, k3d, minikube, and remote clusters via allow_k8s_contexts
  • Shared team dev environment: tilt up --host=0.0.0.0 and forward the UI port

Key Features

  • Live-update skips full image rebuilds for 10x faster inner-loop iteration
  • Resource graph visualizer makes dependency chains obvious
  • Built-in support for Helm, Kustomize, ytt, and raw manifests in one Tiltfile
  • Extension registry at tilt.dev/extensions for Postgres, cert-manager, Redis, and more
  • Snapshot feature captures a dev session for bug reports

Comparison with Similar Tools

  • Skaffold — Google's alternative; similar scope, YAML-config-first vs Starlark
  • Garden — focuses on full-stack envs incl. tests; heavier config
  • Okteto — cloud-hosted dev envs; great UX but not self-hosted
  • DevSpace — declarative YAML, similar hot-reload goals
  • Docker Compose — simple but Kubernetes-free; no service mesh / operators

FAQ

Q: Does Tilt work with a remote cluster? A: Yes — whitelist the context with allow_k8s_contexts("my-dev-cluster"). Many teams run a shared dev cluster this way.

Q: How is live-update different from a rebuild? A: Live-update copies changed files into the running pod and optionally runs a restart command, skipping the entire image build/push cycle.

Q: Can I use Tilt in CI? A: The tilt ci mode runs the Tiltfile once, waits for readiness, and exits non-zero on failure — perfect for smoke tests.

Q: Does Tilt replace Helm? A: No. Tilt invokes Helm (or Kustomize) and adds the dev loop around it.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产