文件
k3s/flux/clusters/base/infra-gitops.yaml
T

48 行
1.2 KiB
YAML

apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-gitops
namespace: infra-gitops
spec:
interval: 30m
timeout: 15m
retryInterval: 1m
sourceRef:
kind: GitRepository
name: flux
path: ./flux/infrastructure/infra-gitops
prune: true
wait: true
dependsOn:
- name: infra-data-post-2
- name: infra-monitor
---
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infra-gitops-post
namespace: infra-gitops
spec:
# drone/envsubst 不支持多变量逻辑或,因此聚合判断放在 .env → flux-env Secret 这一步:
# 构建脚本会在 GITEA_ACTIONS_TOKEN / FLUX_WEB_OIDC_CLIENT_ID / FLUX_WEB_OIDC_CLIENT_SECRET
# 任一为空时写入 INFRA_GITOPS_POST_SUSPEND=true,三者全部就绪时写入 false。
# 未设置该变量时(例如旧的 Secret 还没刷新),保守地保持暂停。
suspend: ${INFRA_GITOPS_POST_SUSPEND:=true}
interval: 30m
timeout: 15m
retryInterval: 1m
sourceRef:
kind: GitRepository
name: flux
path: ./flux/infrastructure/infra-gitops/post
prune: true
wait: true
dependsOn:
- name: infra-gitops
- name: infra-net
postBuild:
substituteFrom:
- kind: Secret
name: flux-env