Argo CD Examples
To follow along Argo CD needs to be installed.
Important
The following can be used to install Argo CD to your cluster:
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yamlIf you need a Kind Kubernetes Cluster and ArgoCD Deployed, you can look at: server-deployment/terraform
If you need a kubernetes cluster, gitea and argocd on a kind cluster you can check out: _scripts/bootstrap.sh
Jump to directory: ./helm-values-inside-application/
The helm values are managed inside the Application:
source:
chart: microservice
repoURL: https://charts.ruan.dev
targetRevision: 3.1.1
helm:
values: |
replicaCount: 1Jump to directory: ./helm-values-from-file/
The application is defined in helm-values-from-file/apps/app-dev.yaml and the values are defined in helm-values-from-file/values-dev.yaml and argo will monitor this path on git:
source:
path: helm-values-from-file
repoUrl: https://github.com/ruanbekker/argocd-examples
targetRevision: HEAD
helm:
valueFiles:
- values-dev.yamlJump to directory: ./git-and-list-generators/
The application is defined in git-and-list-generators/multiple-git-tags-application.yaml and listens for applications in apps/ and does the following:
For staging:
- If the commit tag is
stagingit will append astaging-prefix to the name and deploy to thestagingnamespace in thekind-stagingcluster.
For production:
- If the commit tag is
productionit will append aprod-prefix to the name and deploy to theprodnamespace in thekind-prodcluster.
Jump to directory: ./matrix-generators/
The ApplicationSet is defined in git-and-list-generators/multiple-envs-applications.yaml and listens for applications under the apps/ directory in the git repository. It uses a git generator to discover application directories and a matrix generator to combine the application paths with environment-specific configurations (dev, staging, production).
For each environment (dev, staging, production), it deploys the corresponding environment-specific values.yaml file using Helm. The deployments are targeted to the appropriate Kubernetes namespaces (dev, staging, production), and the ApplicationSet automatically handles synchronization, pruning, and namespace creation.