apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
metadata:
  name: bootstrap-local
  annotations:
    description: |
      Phase 0 bootstrap bundle - apply once from local checkout on a fresh cluster.
      Contains only resources that have circular git dependencies (Forgejo hosts
      the repo ArgoCD syncs from). Everything else is GitOps-managed via ArgoCD.

# Resources in strict dependency order
resources:
  - 00-namespaces.yaml           # Pre-create with PodSecurity labels
  - 01-argocd.yaml               # ArgoCD + SOPS plugin ConfigMap
  - 02-cnpg-operator.yaml        # CloudNativePG operator + CRDs
  - 03-ddb-bootstrap.yaml        # PostgreSQL cluster + Forgejo DB + Redis
  - 05-wait-for-databases.yaml   # Wait for CNPG to create databases
  - 04-forgejo.yaml              # Forgejo Helm chart (inline values)
  - 06-ingress-nginx.yaml        # Ingress for Forgejo domain access

# Notes:
# - SOPS age secret created via bootstrap.sh (not in git)
# - After bootstrap: git push → kubectl apply -k k8s/argocd/root → done
# - ALL future changes via git push (ArgoCD auto-syncs)
