Merge pull request: 最终验证 Flux canary 自动 prune
lint / yaml (push) Successful in 17s
lint / yaml (pull_request) Successful in 17s
lint / terraform (pull_request) Successful in 34s
lint / terraform (push) Successful in 32s
lint / ansible (pull_request) Successful in 3m6s
lint / ansible (push) Successful in 2m58s
lint / yaml (push) Successful in 17s
lint / yaml (pull_request) Successful in 17s
lint / terraform (pull_request) Successful in 34s
lint / terraform (push) Successful in 32s
lint / ansible (pull_request) Successful in 3m6s
lint / ansible (push) Successful in 2m58s
This commit was merged in pull request #18.
This commit is contained in:
@@ -37,6 +37,7 @@ What changed in this homelab, when, and why. Newest first.
|
||||
| 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 只做删除 |
|
||||
| prune 验证最终阶段 | 已确认 `prune: true` 生效且测试 ConfigMap 重新进入 Flux inventory;本次只从 Git 删除该对象,不修改 canary 或 root 的 prune 设置,用于完成精确垃圾回收验证 |
|
||||
|
||||
### Incident: prune 启用与对象删除放在同一 revision
|
||||
|
||||
|
||||
@@ -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 中,不会部署**。 |
|
||||
|
||||
@@ -23,6 +22,6 @@ sudo k3s kubectl -n gitops-canary get deployment,service,pod
|
||||
Deployment 漂移修复已经验证:手动把 replicas 改成 1 后,Flux 能按 Git 恢复为
|
||||
2。删除验证使用无业务依赖的 `flux-prune-canary` ConfigMap。首次尝试在同一个
|
||||
revision 中同时开启 prune 并删除对象,Flux 更新了 inventory 但保留了 live 对象。
|
||||
因此先在已经生效的 `prune: true` 下重新纳管 ConfigMap;下一 revision 只删除对象,
|
||||
验证垃圾回收。root Kustomization 始终保持 `prune: false`,brownfield 资源不会
|
||||
进入此次删除范围。
|
||||
因此先在已经生效的 `prune: true` 下重新纳管 ConfigMap,再用下一 revision 只删除
|
||||
对象。最终删除阶段不再修改 prune,确保可以准确验证垃圾回收。root Kustomization
|
||||
始终保持 `prune: false`,brownfield 资源不会进入此次删除范围。
|
||||
|
||||
@@ -2,5 +2,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
resources:
|
||||
- deployment.yaml
|
||||
- prune-canary-configmap.yaml
|
||||
- service.yaml
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: flux-prune-canary
|
||||
data:
|
||||
purpose: verify-controlled-flux-pruning
|
||||
Reference in New Issue
Block a user