Bootstrap ArgoCD for GitOps Deployment
ArgoCD and GitOps
Section titled “ArgoCD and GitOps”Step 1: Install ArgoCD
Section titled “Step 1: Install ArgoCD”kubectl apply -k bootstrap/argocdkubectl wait --for=condition=available --timeout=600s deployment/argocd-server -n argocdkubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath='{.data.password}' | base64 -d; echoStep 2: Prepare GitOps bootstrap
Section titled “Step 2: Prepare GitOps bootstrap”Update these files if you fork the repo. The default references point to nsudhanva/homelab:
bootstrap/root.yamlbootstrap/templates/infra-appset.yamlbootstrap/templates/apps-appset.yamlinfrastructure/cilium/cilium.yaml
Confirm the Longhorn data path in bootstrap/templates/longhorn.yaml matches your host.
flowchart TD Root["bootstrap/root.yaml"] --> Argo["ArgoCD"] Argo --> InfraSet["infra ApplicationSet"] Argo --> AppsSet["apps ApplicationSet"] InfraSet --> InfraApps["infra-* apps from infrastructure/"] AppsSet --> UserApps["app-* apps from apps/"]
Detailed ApplicationSet Wiring
Section titled “Detailed ApplicationSet Wiring”flowchart TB
subgraph Bootstrap["bootstrap/"]
Root["root.yaml"]
InfraAppSet["templates/infra-appset.yaml"]
AppsAppSet["templates/apps-appset.yaml"]
end
subgraph Repo["Git repo"]
InfraDir["infrastructure/*"]
AppsDir["apps/*"]
AppYaml["apps/*/app.yaml"]
end
subgraph Argo["ArgoCD namespace"]
ArgoServer["argocd-server"]
AppSetController["applicationset-controller"]
InfraApps["Applications: infra-*"]
UserApps["Applications: app-*"]
end
Root --> ArgoServer
Root --> InfraAppSet
Root --> AppsAppSet
InfraAppSet --> AppSetController
AppsAppSet --> AppSetController
InfraDir --> InfraApps
AppYaml --> UserApps
AppsDir --> UserApps
AppSetController --> InfraApps
AppSetController --> UserApps
Step 3: Apply the bootstrap
Section titled “Step 3: Apply the bootstrap”kubectl apply -f bootstrap/root.yamlStep 4: Verify ArgoCD applications
Section titled “Step 4: Verify ArgoCD applications”kubectl get apps -n argocdFor adding workloads, see Deploy Apps With GitOps.
How ApplicationSets work
Section titled “How ApplicationSets work”ApplicationSets watch the apps/ and infrastructure/ folders and create applications automatically:
apps/*/app.yamldefinesapp-<name>and its namespaceinfrastructure/*becomesinfra-<folder>
Auto-sync is enabled in the ApplicationSets, so Git is the source of truth.