Add Kustomization config to exclude problematic directories from GitOps

This commit is contained in:
Infrastructure Admin 2025-09-25 20:51:52 -04:00
parent 5fd9934c3a
commit 11f3e9309c
2 changed files with 52 additions and 0 deletions

View file

@ -0,0 +1,34 @@
# GitRepository source for infrastructure
apiVersion: source.toolkit.fluxcd.io/v1
kind: GitRepository
metadata:
name: infrastructure
namespace: flux-system
spec:
interval: 5m
url: http://forgejo-http.forgejo.svc.cluster.local:3000/gitadmin/infrastructure.git
ref:
branch: main
timeout: 60s
secretRef:
name: forgejo-auth
---
# Kustomization to sync infrastructure manifests
apiVersion: kustomize.toolkit.fluxcd.io/v1
kind: Kustomization
metadata:
name: infrastructure
namespace: flux-system
spec:
interval: 10m
path: "./"
prune: true
sourceRef:
kind: GitRepository
name: infrastructure
timeout: 5m
wait: true
# Flux will now use kustomization.yaml to control which resources to sync
commonMetadata:
annotations:
fluxcd.io/managed-by: "flux"

18
kustomization.yaml Normal file
View file

@ -0,0 +1,18 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Core infrastructure
- auth-system/
- cert-manager/
- dns/
- emissary/
- forgejo-k8s.yaml
- pomerium.yaml
# Exclude problematic directories:
# - flux/ (managed by Flux itself)
# - pomerium/ (Helm chart)
# - gitea/ (legacy, replaced by forgejo)
# - bin/ (binaries)
# - cookies.txt, DEPLOYMENT.md (not Kubernetes manifests)