Files
homelab-gitops/clusters/defiant/root-applicationset.yaml
Greg Hendrickson 124a29a0a9 feat: add ArgoCD bootstrap with ApplicationSet pattern
- Add root ApplicationSet using Git Directory Generator
- Configure AppProjects for infrastructure and apps separation
- Add cert-manager with Let's Encrypt ClusterIssuers (staging/prod)
- Add SOPS configuration for age-encrypted secrets
- Add bootstrap documentation (docs/BOOTSTRAP.md)
- Scaffold infrastructure dirs (networking, storage, monitoring)
- Update README with quick start and architecture

GitOps pattern: directories auto-discovered by ArgoCD ApplicationSets
Reference: CNCF App-of-Apps best practices 2025
2026-02-02 18:02:42 +00:00

97 lines
2.6 KiB
YAML

# clusters/defiant/root-applicationset.yaml
# Root ApplicationSet using Git Directory Generator
# Automatically creates ArgoCD Applications for each component in infrastructure/
# Reference: https://argo-cd.readthedocs.io/en/latest/operator-manual/applicationset/Generators-Git/
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: infrastructure
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- git:
repoURL: https://github.com/ghndrx/homelab-gitops.git
revision: HEAD
directories:
- path: infrastructure/*
template:
metadata:
name: '{{ .path.basename }}'
namespace: argocd
labels:
app.kubernetes.io/part-of: homelab-infrastructure
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: infrastructure
source:
repoURL: https://github.com/ghndrx/homelab-gitops.git
targetRevision: HEAD
path: '{{ .path.path }}'
destination:
server: https://kubernetes.default.svc
namespace: '{{ .path.basename }}'
syncPolicy:
automated:
prune: true
selfHeal: true
allowEmpty: false
syncOptions:
- CreateNamespace=true
- PrunePropagationPolicy=foreground
- PruneLast=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: apps
namespace: argocd
spec:
goTemplate: true
goTemplateOptions: ["missingkey=error"]
generators:
- git:
repoURL: https://github.com/ghndrx/homelab-gitops.git
revision: HEAD
directories:
- path: apps/overlays/prod/*
template:
metadata:
name: 'prod-{{ .path.basename }}'
namespace: argocd
labels:
app.kubernetes.io/part-of: homelab-apps
environment: prod
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
project: apps
source:
repoURL: https://github.com/ghndrx/homelab-gitops.git
targetRevision: HEAD
path: '{{ .path.path }}'
destination:
server: https://kubernetes.default.svc
namespace: 'prod-{{ .path.basename }}'
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
retry:
limit: 3
backoff:
duration: 5s
factor: 2
maxDuration: 1m