Merge pull request #2156 from pikasTech/fix/2039-pac-watcher-startup-probes
Pipelines as Code CI / hwlab-web-probe-sentinel-nc01- Success
Pipelines as Code CI / platform-infra-gitea-nc01- Failed
Pipelines as Code CI / unidesk-host- Success

fix(pac): 提升 watcher 启动 backlog 韧性
This commit is contained in:
Lyon
2026-07-15 15:59:53 +08:00
committed by GitHub
4 changed files with 171 additions and 2 deletions
@@ -78,3 +78,28 @@
- 无源码或定向验证阻塞。
- 运行面验收仍等待 PR 合并及主代理执行受控 bootstrap,因此任务保持 `in_progress`
## 启动 backlog 后续
- warning-only admission 收敛后,新 PaC run 已可创建,但 NC01 官方 watcher 在重放历史 PipelineRun 时暴露第二断点:
- Pod `pipelines-as-code-watcher-7f6c87497c-7lhfh``/live` 在集中 reconcile 期间超过 `5s` timeout
- 默认 liveness 在 `initialDelaySeconds: 5``failureThreshold: 3` 下连续失败并重启容器;
- 同期 readiness 失败只影响流量就绪,liveness 重启会反复打断历史 backlog 初始同步。
- owning YAML 新增 `release.workloads.watcher`,明确声明:
- watcher Deployment 与 container identity
- startup、readiness 与 liveness 三类 HTTP probe
- startup backlog 窗口和 liveness 延迟全部由 YAML 持有,代码不提供隐藏数值默认值。
- PaC bootstrap 下载官方 v0.48.0 release manifest 后,在 apply 前按 YAML 精确匹配 watcher Deployment/container 并渲染探针:
- 未匹配 Deployment 或 container 时直接失败;
- 不使用 runtime patch、第二份 manifest 或手工 `kubectl patch`
- 后续官方 release reapply 仍由同一 bootstrap 渲染相同 desired state。
- 启动窗口采用:
- startup:延迟 `30s`,每 `10s` 检查,单次 timeout `5s`,允许 `60` 次失败;
- liveness:延迟 `180s`,每 `10s` 检查,允许 `6` 次失败;
- readiness:保留 `5s` 延迟、`10s` 周期和 `3` 次失败,只控制就绪状态。
- 定向验证:
- `bun test scripts/src/platform-infra-pipelines-as-code-bootstrap.test.ts``13 pass, 0 fail, 66 expect()`
- 使用真实 v0.48.0 上游 manifest 验证:共解析 `35` 个对象,精确命中 `pipelines-as-code-watcher/pac-watcher` 并渲染三类 YAML-owned probe
- `bun scripts/cli.ts platform-infra pipelines-as-code plan --target NC01 --consumer hwlab-nc01-v03 --json`:成功披露 watcher probes`warnings=[]`
- `git diff --check`:通过。
- 合并后只允许由 PaC migrated consumer 的正常 PR merge 自动链触发交付;不得人工执行 PipelineRun、mirror、trigger、sync、flush、Argo sync、runtime patch 或删除历史业务对象。