tilt
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTilt
Tilt
First Action: Check for Errors
第一步:检查错误
Before investigating issues or verifying deployments, check resource health:
bash
undefined在排查问题或验证部署之前,请检查资源健康状况:
bash
undefinedFind errors and pending resources (primary health check)
Find errors and pending resources (primary health check)
tilt get uiresources -o json | jq -r '.items[] | select(.status.runtimeStatus == "error" or .status.updateStatus == "error" or .status.updateStatus == "pending") | "(.metadata.name): runtime=(.status.runtimeStatus) update=(.status.updateStatus)"'
tilt get uiresources -o json | jq -r '.items[] | select(.status.runtimeStatus == "error" or .status.updateStatus == "error" or .status.updateStatus == "pending") | "(.metadata.name): runtime=(.status.runtimeStatus) update=(.status.updateStatus)"'
Quick status overview
Quick status overview
tilt get uiresources -o json | jq '[.items[].status.updateStatus] | group_by(.) | map({status: .[0], count: length})'
undefinedtilt get uiresources -o json | jq '[.items[].status.updateStatus] | group_by(.) | map({status: .[0], count: length})'
undefinedNon-Default Ports
非默认端口
When Tilt runs on a non-default port, add :
--portbash
tilt get uiresources --port 37035
tilt logs <resource> --port 37035当Tilt运行在非默认端口时,添加参数:
--portbash
tilt get uiresources --port 37035
tilt logs <resource> --port 37035Resource Status
资源状态
bash
undefinedbash
undefinedAll resources with status
All resources with status
tilt get uiresources -o json | jq '.items[] | {name: .metadata.name, runtime: .status.runtimeStatus, update: .status.updateStatus}'
tilt get uiresources -o json | jq '.items[] | {name: .metadata.name, runtime: .status.runtimeStatus, update: .status.updateStatus}'
Single resource detail
Single resource detail
tilt get uiresource/<name> -o json
tilt get uiresource/<name> -o json
Wait for ready
Wait for ready
tilt wait --for=condition=Ready uiresource/<name> --timeout=120s
**Status values:**
- RuntimeStatus: `ok`, `error`, `pending`, `none`, `not_applicable`
- UpdateStatus: `ok`, `error`, `pending`, `in_progress`, `none`, `not_applicable`tilt wait --for=condition=Ready uiresource/<name> --timeout=120s
**状态值说明:**
- RuntimeStatus: `ok`, `error`, `pending`, `none`, `not_applicable`
- UpdateStatus: `ok`, `error`, `pending`, `in_progress`, `none`, `not_applicable`Logs
日志
bash
tilt logs <resource>
tilt logs <resource> --since 5m
tilt logs <resource> --tail 100
tilt logs --json # JSON Lines outputbash
tilt logs <resource>
tilt logs <resource> --since 5m
tilt logs <resource> --tail 100
tilt logs --json # JSON Lines outputTrigger and Lifecycle
触发与生命周期
bash
tilt trigger <resource> # Force update
tilt up # Start
tilt down # Stop and clean upbash
tilt trigger <resource> # 强制更新
tilt up # 启动
tilt down # 停止并清理Running tilt up
运行tilt up
Run in tmux to survive session reloads:
bash
SESSION=$(basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $PWD)
if ! tmux has-session -t "$SESSION" 2>/dev/null; then
tmux new-session -d -s "$SESSION" -n tilt
tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
elif ! tmux list-windows -t "$SESSION" -F '#{window_name}' | grep -q "^tilt$"; then
tmux new-window -t "$SESSION" -n tilt
tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
fi在tmux中运行,以在会话重新加载后继续存活:
bash
SESSION=$(basename $(git rev-parse --show-toplevel 2>/dev/null) || basename $PWD)
if ! tmux has-session -t "$SESSION" 2>/dev/null; then
tmux new-session -d -s "$SESSION" -n tilt
tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
elif ! tmux list-windows -t "$SESSION" -F '#{window_name}' | grep -q "^tilt$"; then
tmux new-window -t "$SESSION" -n tilt
tmux send-keys -t "$SESSION:tilt" 'tilt up' Enter
fiCritical: Never Restart for Code Changes
重要提示:代码变更时切勿重启
Tilt live-reloads automatically. Never suggest restarting for:
tilt up- Tiltfile edits
- Source code changes
- Kubernetes manifest updates
Restart only for: Tilt version upgrades, port/host changes, crashes, cluster context switches.
Tilt会自动热重载。对于以下情况,切勿建议重启:
tilt up- Tiltfile编辑
- 源代码变更
- Kubernetes清单更新
仅在以下情况时重启:Tilt版本升级、端口/主机变更、程序崩溃、集群上下文切换。
References
参考资料
- TILTFILE_API.md - Tiltfile authoring
- CLI_REFERENCE.md - Complete CLI with JSON patterns
- https://docs.tilt.dev/
- TILTFILE_API.md - Tiltfile编写指南
- CLI_REFERENCE.md - 包含JSON模式的完整CLI参考
- https://docs.tilt.dev/