Argo CD GitOps Repository¶
Overview¶
Defines a reusable repository layout and an app-of-apps root. Argo CD watches one root Application; that root creates the platform and workload Applications.
Recommended Layout¶
gitops-vps/
├── bootstrap/root.yaml
├── clusters/vps-prod/apps/
│ ├── platform.yaml
│ └── workloads.yaml
├── platform/
│ ├── cert-manager/
│ ├── external-secrets/
│ ├── observability/
│ ├── postgres/
│ ├── redis/
│ └── redpanda/
└── workloads/
└── example-api/
Each component owns a Helm values.yaml and an Argo CD Application. Keep environment-specific hostnames, sizes, and feature flags under clusters/vps-prod; do not duplicate shared manifests.
Root Application¶
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: vps-prod
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/example/gitops-vps.git
targetRevision: main
path: clusters/vps-prod/apps
directory:
recurse: true
destination:
server: https://kubernetes.default.svc
namespace: argocd
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- CreateNamespace=true
Bootstrap once:
kubectl apply -f bootstrap/root.yaml
argocd app get vps-prod
Rules¶
- Pin chart versions and review upgrades through pull requests.
- Let Argo CD own deployed resources; avoid manual
helm upgradeafter bootstrap. - Use sync waves for CRDs/operators before their custom resources.
- Enable pruning only with protected branches and review.
- Never commit plaintext credentials, kubeconfig files, or private keys.