Anything you do to Argo CD twice should be automated. This walks the path from a manual install to a repeatable, pipeline-driven setup.
1. Install it reproducibly
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
kubectl -n argocd get pods2. Describe the desired state
An Application that tracks a Git path and self-heals.
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata: { name: web, namespace: argocd }
spec:
project: default
source:
repoURL: https://github.com/acme/deploy.git
targetRevision: main
path: apps/web
destination:
server: https://kubernetes.default.svc
namespace: web
syncPolicy:
automated: { prune: true, selfHeal: true }
syncOptions: [CreateNamespace=true]3. Run it from CI
CI only updates the image tag in Git; Argo CD does the deploy.
bump-image:
script:
- yq -i '.image.tag = strenv(CI_COMMIT_SHA)' apps/web/values.yaml
- git commit -am "web $CI_COMMIT_SHA" && git pushWant senior help putting Argo CD to work - or a team bootcamp on it? CodeWizard runs Israel's largest DevOps community and embeds named senior engineers with a transparent hours log. Book a free consult or explore the Academy.