diff --git a/CHANGELOG.md b/CHANGELOG.md index 7eac0d3..3f8d283 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,14 @@ What changed in this homelab, when, and why. Newest first. | GitOps canary | 加入由 Flux 部署到独立 `gitops-canary` namespace 的 `http-echo` Deployment 和 Service;历史 Contour HTTPRoute 明确排除在 Kustomization 之外,初始保持 `prune: false` | | prune 验证 | 为 `http-echo` 加入无业务依赖的 `flux-prune-canary` ConfigMap;先在 `prune: false` 下确认 Flux inventory,后续通过独立 PR 删除并仅为 canary 开启 prune | | prune 验证第二阶段 | 第一阶段已确认 `flux-prune-canary` 带 Flux ownership 标签并进入 `http-echo` inventory;从 Git 删除该测试对象,同时仅为 `http-echo` 开启 `prune: true`,root 继续保持 `prune: false` | +| prune 验证修正 | 第二阶段证明“同一 revision 开启 prune 并删除旧对象”不会回收该对象:Flux 已从 inventory 移除它,但 live ConfigMap 保留。将 ConfigMap 在已经生效的 `prune: true` 下重新纳管,下一 revision 只做删除 | + +### Incident: prune 启用与对象删除放在同一 revision + +测试把 `http-echo` 从 `prune: false` 改为 `true` 的同时从 Git 删除测试 +ConfigMap。Flux 按新 revision 更新了 inventory,但没有删除按旧设置管理的 live +对象,导致 ConfigMap 成为 inventory 之外的残留。没有业务影响。修正方式是在 +`prune: true` 已经生效后先重新纳管对象,再用下一 revision 单独删除。 `Carried forward`: re-verify OpenBao/ESO recovery and remaining Secret inventory; configure an off-site Git mirror; plan the Gitea upgrade beyond 1.25.5; diff --git a/apps/http-echo/README.md b/apps/http-echo/README.md index 9bf8914..a6fdb1f 100644 --- a/apps/http-echo/README.md +++ b/apps/http-echo/README.md @@ -7,6 +7,7 @@ Flux 将它部署到独立的 `gitops-canary` namespace。 | --- | --- | | `deployment.yaml` | 两个 `hashicorp/http-echo` 副本。 | | `service.yaml` | 只在集群内可达的 ClusterIP Service。 | +| `prune-canary-configmap.yaml` | 无业务依赖的临时资源,用于验证 Flux 受控删除。 | | `kustomization.yaml` | Flux 实际构建入口;明确排除历史 HTTPRoute。 | | `httproute.yaml` | 保留的历史 Contour 示例,**不在 Kustomization 中,不会部署**。 | @@ -20,7 +21,8 @@ sudo k3s kubectl -n gitops-canary get deployment,service,pod ``` Deployment 漂移修复已经验证:手动把 replicas 改成 1 后,Flux 能按 Git 恢复为 -2。删除验证使用无业务依赖的 `flux-prune-canary` ConfigMap:第一阶段已经在 -`prune: false` 时创建并确认进入 Flux inventory;本阶段从 Git 删除该对象,并仅为 -`http-echo` Kustomization 开启 `prune: true`。root Kustomization 仍保持 -`prune: false`,brownfield 资源不会进入此次删除范围。 +2。删除验证使用无业务依赖的 `flux-prune-canary` ConfigMap。首次尝试在同一个 +revision 中同时开启 prune 并删除对象,Flux 更新了 inventory 但保留了 live 对象。 +因此先在已经生效的 `prune: true` 下重新纳管 ConfigMap;下一 revision 只删除对象, +验证垃圾回收。root Kustomization 始终保持 `prune: false`,brownfield 资源不会 +进入此次删除范围。 diff --git a/apps/http-echo/kustomization.yaml b/apps/http-echo/kustomization.yaml index a33121c..287f330 100644 --- a/apps/http-echo/kustomization.yaml +++ b/apps/http-echo/kustomization.yaml @@ -2,4 +2,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - deployment.yaml + - prune-canary-configmap.yaml - service.yaml diff --git a/apps/http-echo/prune-canary-configmap.yaml b/apps/http-echo/prune-canary-configmap.yaml new file mode 100644 index 0000000..0d8be6f --- /dev/null +++ b/apps/http-echo/prune-canary-configmap.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: flux-prune-canary +data: + purpose: verify-controlled-flux-pruning