Bootstrap ArgoCD for GitOps Deployment
ArgoCD and GitOps
Section titled “ArgoCD and GitOps”ArgoCD is the primary declarative engine for the cluster. It continuously synchronizes Kubernetes resources against the master branch of this repository.
Step 1: Automated vs Manual Installation
Section titled “Step 1: Automated vs Manual Installation”When running ./scripts/provision.sh, the Ansible role ansible/roles/argocd installs ArgoCD and applies the root application automatically.
If you ever need to manually deploy or recover ArgoCD:
kubectl apply --server-side --force-conflicts -k bootstrap/argocdkubectl wait --for=condition=available --timeout=600s deployment/argocd-server -n argocdRetrieve the initial admin password:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d; echoStep 2: The ApplicationSet pattern
Section titled “Step 2: The ApplicationSet pattern”The repository uses two ApplicationSets in bootstrap/templates/:
flowchart TD Root["bootstrap/root.yaml"] --> Argo["ArgoCD Engine"] Argo --> InfraSet["infra ApplicationSet"] Argo --> AppsSet["apps ApplicationSet"] InfraSet --> InfraApps["infra-* apps (infrastructure/*)"] AppsSet --> UserApps["app-* apps (apps/*)"]
bootstrap/templates/infra-appset.yaml: Discovers every subdirectory ininfrastructure/and deploys its manifests or Helm charts into the cluster.bootstrap/templates/apps-appset.yaml: Discovers workloads viaapps/*/app.yamland deploys applications into target namespaces with auto-prune and self-healing.
Step 3: Apply the root bootstrap application
Section titled “Step 3: Apply the root bootstrap application”To trigger reconciliation of all infrastructure components and applications:
kubectl apply -f bootstrap/root.yamlArgoCD reconciles root.yaml, which creates the ApplicationSets, which in turn generate and synchronize all applications across the cluster.
Step 4: Verify application sync status
Section titled “Step 4: Verify application sync status”Check that all applications report Synced and Healthy:
kubectl get applications -n argocdTo add a new workload or infrastructure component, push your manifests directly to Git; ArgoCD deploys them automatically.