Tilt
Tilt provides a fast, iterative development experience for Kubernetes. Instead of rebuilding Docker images and redeploying for every change, Tilt watches your files and syncs changes directly into running containers.
Prerequisites
Required Tools
| Tool | Version | Installation |
|---|---|---|
| Tilt | Latest | brew install tilt or install.sh |
| Kind | 0.20+ | brew install kind |
| kubectl | 1.28+ | brew install kubectl |
| Docker | 24+ | Docker Desktop |
Verify Installation
# Check Tilt
tilt version
# Check Kind cluster exists
kind get clusters | grep knodex-qaQuick Start
# 1. Create Kind cluster (one-time setup)
make cluster-up
# 2. Start Tilt
make tilt-up
# 3. Open Tilt UI in browser
# http://localhost:10350That's it! Tilt will:
- Build development Docker images
- Deploy to your Kind cluster
- Watch for file changes
- Automatically sync/rebuild as needed
How It Works
Architecture
┌─────────────────────────────────────────────────────────────────┐
│ Your Machine │
├──────────────────────────┬──────────────────────────────────────┤
│ Source Files │ Tilt │
│ │ │
│ server/ │ ┌─────────────────────────────┐ │
│ ├── main.go ────►│ │ Watch for changes │ │
│ └── internal/ ────►│ │ Sync Go files to container │ │
│ │ │ Run Vite locally │ │
│ web/ │ │ Show logs in UI │ │
│ └── src/ ────►│ └─────────────────────────────┘ │
│ │ │ │
│ ┌────────────────┐ │ │ │
│ │ Vite Dev Server │ │ │ │
│ │ localhost:3000 │ │ │ │
│ │ (local process) │ │ │ │
│ └────────────────┘ │ │ │
├──────────────────────────┴──────────────┼────────────────────────┤
│ Kind Cluster │ │
│ ▼ │
│ ┌───────────────────────────────┐ ┌─────────────┐ │
│ │ knodex-server │ │ Redis │ │
│ │ Go server + embedded web │ │ Standard │ │
│ │ App: http://localhost:8080 │ │ Port: 6379 │ │
│ └───────────────────────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘
Live Update Flow
Server (Go):
- You edit a
.gofile - Tilt detects the change
- Files are synced to the container
- Air (hot-reload tool) rebuilds the binary
- New binary starts automatically
- Total time: ~10-15 seconds
Web (React):
- You edit a
.tsxor.cssfile - Vite dev server (running locally via Tilt) detects the change
- Vite's HMR pushes the update to the browser
- Browser updates without refresh
- Total time: ~1-2 seconds
Usage
Starting Tilt
# Standard start
make tilt-up
# Start in background (detached)
tilt up -d
# Start with specific namespace
tilt up -- --namespace=my-namespaceStopping Tilt
# Stop Tilt (keeps resources)
# Press Ctrl+C in terminal
# Stop and cleanup
make tilt-downTilt UI
Open http://localhost:10350 to access the Tilt UI.
Key Features:
- Resource Status: See build/deploy status for each service
- Logs: Live streaming logs from all containers
- Triggers: Manually trigger rebuilds if needed
- Errors: Clear error messages with source locations
Keyboard Shortcuts:
| Key | Action |
|---|---|
s | Open logs for selected resource |
r | Trigger rebuild for selected resource |
j/k | Navigate up/down |
Enter | Select resource |
? | Show help |
Port Forwarding
Tilt automatically sets up port forwarding:
| Service | URL | Description |
|---|---|---|
| Application | http://localhost:8080 | Go server (API + embedded web) |
| Vite HMR | http://localhost:3000 | Vite dev server (hot module reload) |
| Redis | localhost:6379 | Redis cache |
| Tilt UI | http://localhost:10350 | Tilt dashboard |
Use localhost:3000 during active web development for instant HMR updates. Use localhost:8080 to test the production-like embedded build.
Development Workflow
Typical Session
# 1. Start your day
make tilt-up
# 2. Open Tilt UI to monitor
open http://localhost:10350
# 3. Open app in browser
open http://localhost:3000 # Vite HMR (or http://localhost:8080 for embedded)
# 4. Make code changes
# - Server: Edit Go files → Auto-rebuild in ~10s
# - Web: Edit React files → HMR in <2s
# 5. Check logs in Tilt UI if something breaks
# 6. End of day
make tilt-downForcing Rebuilds
Sometimes you need to force a full rebuild:
# In Tilt UI: Click the refresh icon on a resource
# Or via CLI:
tilt trigger knodex-server
tilt trigger web-devViewing Logs
In Tilt UI:
- Click on a resource
- Press
sto open logs - Use scroll to navigate
Via CLI:
# All logs
tilt logs
# Specific resource
tilt logs knodex-server
# Follow mode
tilt logs -f knodex-serverConfiguration
Tiltfile Options
The Tiltfile supports these arguments:
# Use custom namespace
tilt up -- --namespace=my-dev
# Enable enterprise build
tilt up -- --enterprise=trueEnvironment Variables
Set these in your shell or .env file:
# Use a different cluster context
export KUBECONFIG=~/.kube/config
# Tilt-specific settings
export TILT_PORT=10350 # UI portTroubleshooting
Kind Cluster Not Found
Error: No Kubernetes cluster available. Run 'make cluster-up' first.
Solution:
# Check if cluster exists
kind get clusters
# If not, create it
make cluster-upPort Already in Use
Error: bind: address already in use
Solution:
# Find what's using the port
lsof -i :8080
# Kill the process or stop the other service
kill -9 <PID>
# Or use different ports
tilt up -- --namespace=alt-namespaceContainer Crash Loop
Symptoms: Pod keeps restarting, red status in Tilt UI
Debugging:
- Click on the crashing resource in Tilt UI
- Press
sto view logs - Look for error messages at startup
Common causes:
- Go compilation error (check syntax)
- Missing environment variable
- Database/Redis connection failure
Files Not Syncing
Symptoms: Changes not appearing in container
Solutions:
- Check if file is in ignore list (Tiltfile
ignoreparameter) - Trigger manual sync:
tilt trigger <resource> - Check Tilt logs for sync errors
Slow Rebuilds
Server taking too long?
- Ensure
go mod downloadcache is preserved - Check if tests are accidentally running
- Look for expensive initialization in
main()
Web taking too long?
- Check for large node_modules changes
- Ensure Vite cache is working
- Look for heavy imports
Full Reset
When all else fails:
# Stop everything
make tilt-down
# Clean up namespace
kubectl delete namespace knodex-tilt --ignore-not-found
# Remove cached images
docker system prune -f
# Start fresh
make tilt-upComparison with Other Methods
| Method | First Deploy | Code Change | Best For |
|---|---|---|---|
make dev | Instant | Instant | Simple local dev |
make qa | 2-5 min | 2-5 min | E2E testing |
| Tilt | 30-60s | 2-15s | K8s-integrated dev |
When to use Tilt:
- Testing Kubernetes-specific features (ConfigMaps, Secrets, RBAC)
- Working on features that need full cluster environment
- Debugging pod networking or service discovery
- Testing with real Redis in-cluster
When to use make dev:
- Simple web/server changes
- Quick iteration without K8s
- Lower resource usage
Related Resources
- Tilt Documentation
- Testing - Test guide and E2E testing