Why Kubernetes + Tilt?
Compared to Docker Compose, this setup offers:- Production parity: Run the same manifests used in production
- Observability: Prometheus, Grafana, Loki, and Tempo for metrics, logs, and traces
- Network visibility: Hubble UI for visualizing service mesh traffic
- Live updates: Fast rebuild and redeploy on code changes
- Resource dashboard: Visual monitoring of all services in one place
Prerequisites
- Environment setup complete
- Docker Desktop or Docker Engine running
- At least 16GB RAM and 4 CPU cores available
- Infrastructure repository cloned
Bootstrap Options
There are two bootstrap options depending on your available resources:- Full Bootstrap (Recommended)
- Lightweight Bootstrap
Full Observability Stack
Includes Prometheus, Grafana, Loki, Tempo, Istio, ArgoCD, and Hubble UI.Requirements:- 16GB+ RAM
- 4+ CPU cores
- Fast storage (SSD recommended)
Run full bootstrap
Ensure Docker is running, then:This will:
- Create a Kind cluster with multiple worker nodes
- Install Cilium CNI with Hubble
- Deploy Prometheus, Grafana, Loki, and Tempo
- Install Istio service mesh
- Deploy ArgoCD for GitOps
- Configure Traefik as the ingress controller
The bootstrap process takes 10-15 minutes on first run. Subsequent runs are much faster.
Available Dashboards
After full bootstrap, access these UIs:| Service | URL | Credentials |
|---|---|---|
| Grafana | http://localhost:30300 | admin / admin |
| Prometheus | http://localhost:30090 | - |
| Hubble UI | http://localhost:31235 | - |
| Tilt | http://localhost:10350 | - |
| Traefik | http://localhost:30081 | - |
Starting Tilt
Once the cluster is bootstrapped, start the application services:Start Tilt
- Foreground (recommended for first run)
- Background
Run Tilt in the foreground to watch startup logs:Press
space to open the Tilt UI in your browser, or visit http://localhost:10350.Press q to stop Tilt and clean up resources.Monitor startup
Open http://localhost:10350 to see the Tilt dashboard.You’ll see resources building and deploying:
- Bootstrap resources: Cluster setup, manifest generation
- Codegen resources: Protocol Buffer compilation
- Compile resources: Go service compilation (if not using Nix)
- Kubernetes resources: Service deployments with port forwards
Tilt Architecture
The Tiltfile orchestrates the following workflow:Resource Management
Tilt organizes resources into labeled groups:Bootstrap Resources
cluster-up: Ensures Kind cluster existsgen-manifests: Generates Kubernetes manifests from Nix modules
Codegen Resources
buf-generate: Compiles Protocol Buffers to Go and TypeScript
Compile Resources (non-Nix mode)
greeter-compile,caller-compile,gateway-compile: Build Go binaries
Kubernetes Resources
Each service runs as a Kubernetes Deployment:| Service | Port Forward | Dependencies |
|---|---|---|
| traefik | - | gen-manifests |
| caller-service | 8081 | gen-manifests, buf-generate, caller-compile |
| greeter-service | 8080 | gen-manifests, buf-generate, greeter-compile |
| gateway | 8082 | gen-manifests, buf-generate, gateway-compile |
| custom-lang-service | 3000 | gen-manifests |
| auth-service | 8090 | gen-manifests |
| frontend | 5173 | gen-manifests, buf-generate |
Live Updates
Go Services (non-Nix mode)
Tilt usesdocker_build_with_restart for fast iteration:
- Edit Go source code
- Local resource compiles binary (
greeter-compile) - Binary is synced to running container via
live_update - Container restarts with new binary
Live updates skip the full Docker build, making updates nearly instant.
Go Services (Nix mode)
WithUSE_NIX=true, Tilt uses Nix to build reproducible images:
- Edit Go source code
- Nix builds a complete container image
- Image is loaded into Kind cluster
- Kubernetes pulls the new image
Node.js Services
Node.js services use standarddocker_build:
- Edit Node.js source code
- Tilt rebuilds the Docker image
- Image is pushed to Kind
- Kubernetes redeploys the pod
Frontend
Frontend usesdocker_build with build args:
For faster frontend iteration, use the local dev server instead of rebuilding Docker images.
Port Forwards
Tilt automatically forwards these ports to localhost:| Service | Local Port | Pod Port |
|---|---|---|
| greeter-service | 8080 | 8080 |
| caller-service | 8081 | 8081 |
| gateway | 8082 | 8082 |
| custom-lang-service | 3000 | 3000 |
| auth-service | 8090 | 8090 |
| frontend | 5173 | 80 |
| Service | Local Port |
|---|---|
| Traefik | 30081 |
| Grafana | 30300 |
| Prometheus | 30090 |
| Hubble UI | 31235 |
Environment Variables
Tilt honors these environment variables:USE_NIX
Default: false
Use Nix to build container images for Go services:
TILT_SKIP_CLUSTER_UP
Default: false
Skip the cluster-up resource if you’ve already created the cluster manually:
Debugging
Check resource status
In the Tilt UI (http://localhost:10350):- Green: Resource is healthy
- Yellow: Resource is building/updating
- Red: Resource failed
Manual health check
Tilt includes a manual health check resource:- Open Tilt UI
- Find
health-checkin the resource list - Click the trigger button
Debug Kubernetes directly
Use thedebug-k8s command from devenv:
Debug gRPC services
grpcurl.
View logs
Common Operations
Restart a service
In Tilt UI:- Find the service resource
- Click the ⟳ (restart) button
Trigger a rebuild
In Tilt UI:- Find the service resource
- Click the ⚡ (rebuild) button
Stop Tilt
- Foreground
- Background
Press
q in the terminal running tilt up.Destroy the cluster
Updating Manifests
Kubernetes manifests are generated from Nix modules indeploy/nixidy/.
Edit manifest configuration
- Edit files in
deploy/nixidy/env/ordeploy/k8s/ - Regenerate manifests:
- Tilt auto-detects changes and reapplies
Observability (Full Bootstrap Only)
Grafana Dashboards
Access Grafana at http://localhost:30300 (admin/admin). Pre-configured dashboards:- Kubernetes cluster metrics: Node and pod resource usage
- Service metrics: Request rates, latencies, error rates
- Logs (Loki): Aggregated logs from all services
- Traces (Tempo): Distributed tracing for requests
Prometheus
Query metrics at http://localhost:30090. Example queries:Hubble UI
Visualize service mesh traffic at http://localhost:31235.- View real-time network flows
- Inspect HTTP/gRPC requests
- Debug connectivity issues
Performance Tips
Reduce resource usage
- Use lightweight bootstrap instead of full
- Disable unused services in Tiltfile
- Limit Kind cluster resources in
kind-config.yaml
Speed up builds
- Use
USE_NIX=falsefor faster Go builds - Leverage Docker build cache (avoid
--no-cache) - Use
live_updatefor instant Go binary sync
Optimize dependencies
In Tiltfile, carefully manageresource_deps to avoid unnecessary rebuilds:
Troubleshooting
Tilt won’t start
Check cluster:Resource stuck in yellow/red
- Click the resource in Tilt UI
- Check logs for errors
- Common fixes:
- Run
buf generateif proto changes aren’t detected - Run
gen-manifestsif Nix changes aren’t applied - Restart Tilt:
tilt down && tilt up
- Run
Port forward failures
If a port is already in use:Manifests not found
If you see “No Kubernetes manifests found yet”:Nix only sees files tracked by git. Always
git add new files before running gen-manifests.Image pull errors
If Kubernetes can’t pull images:Next Steps
Frontend Development
Fast iteration with local dev server
Docker Compose
Simpler alternative for basic development