feat(gitops): staged 接管 Gitea Actions Helm release
lint / yaml (push) Successful in 14s
lint / yaml (pull_request) Successful in 17s
lint / terraform (pull_request) Successful in 33s
lint / terraform (push) Successful in 29s
lint / ansible (push) Successful in 6m18s
lint / ansible (pull_request) Successful in 6m13s
lint / yaml (push) Successful in 14s
lint / yaml (pull_request) Successful in 17s
lint / terraform (pull_request) Successful in 33s
lint / terraform (push) Successful in 29s
lint / ansible (push) Successful in 6m18s
lint / ansible (pull_request) Successful in 6m13s
This commit is contained in:
@@ -23,6 +23,7 @@ What changed in this homelab, when, and why. Newest first.
|
|||||||
|---|---|
|
|---|---|
|
||||||
| GitOps | PR #18 合并后,Flux 自行发现 revision `f257a2a` 并删除已在 `prune: true` 下重新进入 inventory 的测试 ConfigMap;未发送 reconcile annotation,`http-echo` Deployment/Service 保持 Ready,root 继续 `prune: false` |
|
| GitOps | PR #18 合并后,Flux 自行发现 revision `f257a2a` 并删除已在 `prune: true` 下重新进入 inventory 的测试 ConfigMap;未发送 reconcile annotation,`http-echo` Deployment/Service 保持 Ready,root 继续 `prune: false` |
|
||||||
| Helm migration | 选定 `gitea-actions` 作为第一个 Flux HelmRelease adoption:它不承载 Git、入口、DNS、证书、数据库或 secrets controller。live StatefulSet 与 Git 都使用 regular DinD,但 Helm 保存的 release values/manifest 仍是失败的 rootless 配置;接管先固定 chart `0.1.1` 并验证 live Pod spec 不变,升级另开 PR |
|
| Helm migration | 选定 `gitea-actions` 作为第一个 Flux HelmRelease adoption:它不承载 Git、入口、DNS、证书、数据库或 secrets controller。live StatefulSet 与 Git 都使用 regular DinD,但 Helm 保存的 release values/manifest 仍是失败的 rootless 配置;接管先固定 chart `0.1.1` 并验证 live Pod spec 不变,升级另开 PR |
|
||||||
|
| Helm adoption stage | 为 `gitea-actions` 加入固定 chart `0.1.1` 的 HelmRepository、values ConfigMap 和 `suspend: true` HelmRelease;第一阶段只让 Flux 登记对象,确认 source 与固定 chart render 后再解除 suspend,失败策略使用 `RetryOnFailure` 以避免回滚到 stored rootless manifest |
|
||||||
|
|
||||||
`Carried forward`: adopt `gitea-actions` with a zero-change HelmRelease; then
|
`Carried forward`: adopt `gitea-actions` with a zero-change HelmRelease; then
|
||||||
order the remaining Helm migrations by dependency and blast radius. Root Flux
|
order the remaining Helm migrations by dependency and blast radius. Root Flux
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
apiVersion: kustomize.toolkit.fluxcd.io/v1
|
||||||
|
kind: Kustomization
|
||||||
|
metadata:
|
||||||
|
name: gitea-actions
|
||||||
|
namespace: flux-system
|
||||||
|
spec:
|
||||||
|
interval: 10m
|
||||||
|
path: ./platform/gitea-runner
|
||||||
|
prune: false
|
||||||
|
sourceRef:
|
||||||
|
kind: GitRepository
|
||||||
|
name: flux-system
|
||||||
|
timeout: 3m
|
||||||
|
wait: false
|
||||||
@@ -3,4 +3,5 @@ kind: Kustomization
|
|||||||
resources:
|
resources:
|
||||||
- flux-system
|
- flux-system
|
||||||
- namespaces/gitops-canary.yaml
|
- namespaces/gitops-canary.yaml
|
||||||
|
- apps/gitea-actions.yaml
|
||||||
- apps/http-echo.yaml
|
- apps/http-echo.yaml
|
||||||
|
|||||||
@@ -26,6 +26,12 @@ rootless DinD 尝试,但 live StatefulSet 与本目录 `values.yaml` 都已经
|
|||||||
DinD。首次 reconcile 的验收条件是修正 Helm 存储状态,同时 live Pod spec、PVC
|
DinD。首次 reconcile 的验收条件是修正 Helm 存储状态,同时 live Pod spec、PVC
|
||||||
identity、runner capacity 和在线状态保持不变。接管稳定后再用独立 PR 升级 chart。
|
identity、runner capacity 和在线状态保持不变。接管稳定后再用独立 PR 升级 chart。
|
||||||
|
|
||||||
|
接管分两阶段:第一阶段提交 `suspend: true` 的 HelmRelease、HelmRepository 和由
|
||||||
|
`values.yaml` 生成的 ConfigMap。Flux 只登记这些对象,不执行 Helm action。合并后
|
||||||
|
检查 HelmRepository Ready,并用固定 chart 重复比较期望清单与 live StatefulSet;
|
||||||
|
第二阶段才解除 suspend。失败重试使用 `RetryOnFailure`,不会用 stored rootless
|
||||||
|
release 做 rollback。
|
||||||
|
|
||||||
## 历史 review-first bootstrap
|
## 历史 review-first bootstrap
|
||||||
|
|
||||||
这是 Flux 安装前执行过的一次性手动部署流程,保留用于恢复和审计:
|
这是 Flux 安装前执行过的一次性手动部署流程,保留用于恢复和审计:
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
apiVersion: helm.toolkit.fluxcd.io/v2
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: gitea-actions
|
||||||
|
namespace: gitea-actions
|
||||||
|
spec:
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: actions
|
||||||
|
interval: 1h
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: gitea-charts
|
||||||
|
version: 0.1.1
|
||||||
|
driftDetection:
|
||||||
|
mode: enabled
|
||||||
|
install:
|
||||||
|
strategy:
|
||||||
|
name: RetryOnFailure
|
||||||
|
retryInterval: 5m
|
||||||
|
interval: 30m
|
||||||
|
releaseName: gitea-actions
|
||||||
|
suspend: true
|
||||||
|
targetNamespace: gitea-actions
|
||||||
|
timeout: 10m
|
||||||
|
upgrade:
|
||||||
|
strategy:
|
||||||
|
name: RetryOnFailure
|
||||||
|
retryInterval: 5m
|
||||||
|
valuesFrom:
|
||||||
|
- kind: ConfigMap
|
||||||
|
name: gitea-actions-values
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: source.toolkit.fluxcd.io/v1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: gitea-charts
|
||||||
|
namespace: gitea-actions
|
||||||
|
spec:
|
||||||
|
interval: 1h
|
||||||
|
url: https://dl.gitea.com/charts/
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
labels:
|
||||||
|
reconcile.fluxcd.io/watch: Enabled
|
||||||
|
configMapGenerator:
|
||||||
|
- name: gitea-actions-values
|
||||||
|
namespace: gitea-actions
|
||||||
|
files:
|
||||||
|
- values.yaml=values.yaml
|
||||||
|
resources:
|
||||||
|
- namespace.yaml
|
||||||
|
- external-secret.yaml
|
||||||
|
- helmrepository.yaml
|
||||||
|
- helmrelease.yaml
|
||||||
Reference in New Issue
Block a user