Skip to content

Guide

Building a GitOps Pipeline With Argo CD

From git push to a reconciled Kubernetes deployment.

1 min read
  • Kubernetes
  • Platform Engineering

The idea

GitOps replaces “run a deploy command” with “make the cluster match Git”. The cluster becomes a thing that continuously reconciles itself toward a described state, rather than a thing that is pushed to.

Delivery path with a GitOps stage.

text
git push
 ↓
CI: build + test + scan
 ↓
Push image to registry
 ↓
Update desired state in Git
 ↓
Argo CD detects drift
 ↓
Sync to cluster
 ↓
Health checks pass

The application repository and the deployment repository can be the same or separate. What matters is that the cluster’s desired state is always readable from Git.

An Application is the object that connects a Git path to a cluster location:

yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: inference-api
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://github.com/your-handle/platform-config
    targetRevision: main
    path: apps/inference-api
  destination:
    server: https://kubernetes.default.svc
    namespace: ai-platform
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

What changed in practice

The hard part is not installing Argo CD. It is deciding what belongs in the desired-state repository, how secrets are handled, and how much drift the cluster is allowed to self-correct.

Related