| 执行时机 | Pod 终止流程开始、SIGTERM 之前 |
|---|---|
| 类型 | exec / httpGet,同步执行 |
| 计时 | 占用 terminationGracePeriodSeconds 额度 |
| 常用模式 | sleep 让 LB 完成摘流 |
preStop 示例
preStop 示例
lifecycle:
preStop:
exec:
command: ["sh", "-c", "sleep 5"]sleep 时长按「LB 摘流感知时间 + 连接排空时间」估算;不同 LB 实现感知延迟不同。