From 45e3effcbeae3cad5d59f43e0ae1af813d55035e Mon Sep 17 00:00:00 2001 From: panxiao81 Date: Wed, 9 Sep 2026 20:08:09 +0000 Subject: [PATCH] =?UTF-8?q?test(gitops):=20=E9=AA=8C=E8=AF=81=20canary=20p?= =?UTF-8?q?rune?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + apps/http-echo/README.md | 13 +++++-------- apps/http-echo/kustomization.yaml | 1 - apps/http-echo/prune-canary-configmap.yaml | 6 ------ clusters/homelab/apps/http-echo.yaml | 2 +- 5 files changed, 7 insertions(+), 16 deletions(-) delete mode 100644 apps/http-echo/prune-canary-configmap.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9477f94..7eac0d3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -35,6 +35,7 @@ What changed in this homelab, when, and why. Newest first. | cleanup | 已把 `bao-acme` HTTP-01 solver 改到 Envoy Gateway 的明文 listener,并删除不再承载流量的 Contour namespace、provisioner、RBAC、GatewayClass 和全部 `projectcontour.io` CRD;Envoy Gateway、证书、DNS 与 Gitea 复查正常 | | 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` | `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 628178d..9bf8914 100644 --- a/apps/http-echo/README.md +++ b/apps/http-echo/README.md @@ -7,7 +7,6 @@ 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,10 +19,8 @@ sudo k3s kubectl -n flux-system get kustomization http-echo sudo k3s kubectl -n gitops-canary get deployment,service,pod ``` -初始 `prune: false`。验证自动部署后,可以手动把 Deployment replicas 改成 1, -确认 Flux 恢复为 Git 中的 2。删除行为应使用单独的无业务 ConfigMap 和 PR 测试, -验证完成前不得为此路径启用 prune。 - -`flux-prune-canary` ConfigMap 分两次 PR 验证:第一次在 `prune: false` 时创建并 -确认进入 Flux inventory;第二次从清单删除它,同时仅为 `http-echo` -Kustomization 开启 prune,确认 Flux 只删除这个测试对象。 +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 资源不会进入此次删除范围。 diff --git a/apps/http-echo/kustomization.yaml b/apps/http-echo/kustomization.yaml index 287f330..a33121c 100644 --- a/apps/http-echo/kustomization.yaml +++ b/apps/http-echo/kustomization.yaml @@ -2,5 +2,4 @@ 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 deleted file mode 100644 index 0d8be6f..0000000 --- a/apps/http-echo/prune-canary-configmap.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: flux-prune-canary -data: - purpose: verify-controlled-flux-pruning diff --git a/clusters/homelab/apps/http-echo.yaml b/clusters/homelab/apps/http-echo.yaml index e0de6c1..862377a 100644 --- a/clusters/homelab/apps/http-echo.yaml +++ b/clusters/homelab/apps/http-echo.yaml @@ -11,7 +11,7 @@ spec: namespace: gitops-canary interval: 10m path: ./apps/http-echo - prune: false + prune: true sourceRef: kind: GitRepository name: flux-system