mirror of
https://github.com/ghndrx/homelab-gitops.git
synced 2026-02-09 22:34:55 +00:00
- 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
2.4 KiB
2.4 KiB
Cluster Bootstrap Guide
This guide walks through bootstrapping a new k3s cluster with ArgoCD GitOps.
Prerequisites
- k3s cluster running
kubectlconfigured with cluster accessageinstalled for SOPS encryption- GitHub repo access configured
1. Install ArgoCD
# Create namespace
kubectl create namespace argocd
# Install ArgoCD
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Wait for pods
kubectl wait --for=condition=available deployment/argocd-server -n argocd --timeout=300s
2. Configure SOPS
# Generate age key (one-time)
age-keygen -o ~/.config/sops/age/keys.txt
# Get public key
cat ~/.config/sops/age/keys.txt | grep "public key"
# Update .sops.yaml with your public key
# Create k8s secret for ArgoCD to decrypt
kubectl create secret generic sops-age \
--namespace=argocd \
--from-file=key.txt=~/.config/sops/age/keys.txt
3. Bootstrap the Cluster
# Apply root kustomization
kubectl apply -k clusters/defiant/
# This creates:
# - ArgoCD namespace with PSS labels
# - AppProjects (infrastructure, apps)
# - Root ApplicationSets that auto-discover components
4. Access ArgoCD UI
# Get initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d
# Port forward
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Open https://localhost:8080
# Username: admin
5. Verify Infrastructure
After bootstrap, ArgoCD will automatically sync:
- cert-manager - TLS certificate management with Let's Encrypt
- networking - Istio gateway (when configured)
- storage - NFS StorageClass (when configured)
- monitoring - Prometheus/Grafana (when configured)
Adding New Infrastructure
- Create directory under
infrastructure/<component>/ - Add
kustomization.yaml(required) - Add manifests or helmCharts
- Commit and push
- ArgoCD auto-discovers via Git Directory Generator
Adding Applications
- Create base in
apps/base/<app>/ - Create overlay in
apps/overlays/prod/<app>/ - Commit and push
- ArgoCD creates Application automatically
Troubleshooting
# Check ApplicationSet status
kubectl get applicationsets -n argocd
# Check Application sync status
kubectl get applications -n argocd
# View ArgoCD logs
kubectl logs -n argocd deployment/argocd-applicationset-controller