Production-grade · Runs locally on Kind

End-to-end GitOps CI/CD
delivery automation

A production-grade pipeline that ships code from git push to running Kubernetes workloads — automated with GitHub Actions, reconciled by ArgoCD, and observed by a full Prometheus + Grafana stack. All runnable on a single machine.

4
Sequential CI jobs
3
Promoted environments
≥80%
Test coverage enforced
<10m
Lead time to dev
What it does

Git is the single source of truth

No tool pushes directly to Kubernetes. ArgoCD continuously reconciles the live cluster state with exactly what Git declares — every change is an auditable commit.

Declarative delivery, end to end

Push to main and the pipeline lints, tests, security-scans, builds multi-stage container images, and commits the new image tag back to the repo. ArgoCD detects the commit and rolls the change out to the cluster automatically.

The demo application is intentionally trivial — a FastAPI backend and an Nginx frontend — because the pipeline is the product, not the app. Every layer models how a real platform team would ship software safely.

Pull-based over push-based: CI never holds cluster credentials. ArgoCD runs inside the cluster, watches Git, and reconciles — giving you auditability, one-command rollback, and automatic drift detection.
bash — one-command setup
# Clone and bootstrap everything
git clone github.com/…/gitops-cicd-pipeline
cd gitops-cicd-pipeline

# Kind cluster + ArgoCD + Prometheus
# + Grafana + OPA Gatekeeper
make setup

✔ cluster ready
✔ argocd synced (gitops-dev)
✔ observability up

# Watch the full pipeline live
make demo
Key features

Everything a real platform needs

Security, promotion gates, rollback, and observability — wired together, not bolted on.

🔄

Pull-based GitOps

ArgoCD reconciles the cluster to match Git every 3 minutes, with self-heal and drift detection. Deployments are just commits.

🧪

Gated CI pipeline

Lint → test → security-scan → build → update-manifests. Ruff, mypy, pytest with ≥80% coverage, and Kustomize validation all block bad merges.

🚦

Environment promotion

Auto-deploy to dev; manual, approval-gated promotion to staging and prod. Production sync windows block risky weekend deploys.

↩️

Instant rollback

GitOps rollback workflow updates the overlay, ArgoCD resyncs, and a GitHub Issue is opened as an audit trail — MTTR under 10 minutes.

🛡️

Security in depth

Trivy CVE scans, non-root read-only containers, Sealed Secrets, and OPA Gatekeeper admission policies enforced at the API server.

📊

Full observability

Prometheus metrics, pre-built Grafana dashboards, Loki log aggregation, and 7 alert rules covering latency, errors, and rollout health.

CI/CD workflow & architecture

From git push to running pods

Four CI jobs run in sequence on every push to main. The final job commits an image-tag bump — and that commit is what triggers ArgoCD.

JOB 1
🔍
Lint & Test

ruff · mypy · pytest ≥80% · kustomize validate

JOB 2
🔐
Security Scan

Trivy · safety · kubesec → SARIF to GitHub

JOB 3
📦
Build & Push

Multi-stage build → GHCR · image scan blocks CRITICAL

JOB 4
✍️
Update Manifests

kustomize edit set image → commit tag bump

↓ commit to main triggers ArgoCD reconciliation ↓
👩‍💻
Developer

Pushes code to the GitHub repository

⚙️
GitHub Actions

CI builds, scans & commits image tags

🐳
GHCR

Immutable container images by SHA

🎯
ArgoCD

Polls Git · reconciles cluster state

ArgoCD applies desired state to each environment →
🟢
gitops-dev

1 replica · debug logs · auto-sync

🟡
gitops-staging

2 replicas · info logs · manual sync

🔴
gitops-prod

3 replicas · PDB minAvailable 2 · approval-gated

1 · Desired stateGit holds every manifest. source of truth
2 · ReconcileArgoCD diffs desired vs actual every 3 min
3 · ApplyOut of sync? kubectl apply to converge
4 · ObservePrometheus scrapes; Grafana & alerts report health
Tech stack

Built with industry-standard tooling

Chosen deliberately — each tool earns its place with a documented design rationale.

🚀 CI / CD & GitOps

GitHub Actions ArgoCD v2.11 Kustomize v5.4 Helm v3.15

☸️ Orchestration

Kubernetes v1.30 Kind v0.23 Docker ≥24

🧩 Application

FastAPI 0.111 Python 3.12 Nginx 1.27

📈 Observability

Prometheus v2.53 Grafana v11 Loki structlog

🔒 Security

Trivy OPA Gatekeeper v3.16 Sealed Secrets v0.27 kubesec safety

🧰 Quality

pytest ruff mypy shellcheck

🛡️ Security by default

  • Non-root, read-only root filesystem containers with all capabilities dropped
  • Trivy scans for CVEs & secrets — CRITICAL findings fail the build
  • Sealed Secrets: encrypt-once, commit-safely — no plaintext in Git
  • OPA Gatekeeper: required labels, resource limits, no :latest in prod
  • SARIF results published to the GitHub Security tab

📐 Optimised for DORA metrics

Deployment FrequencyEvery push auto-deploys to dev
Multiple / day
Lead Time for ChangesCI ~5 min + ArgoCD ~3 min sync
< 10 min
Change Failure RateTests, scans & OPA policies gate deploys
< 5%
Mean Time to RecoveryGitOps rollback + auto resync
< 10 min

Explore the full pipeline

Every workflow, manifest, policy, and dashboard is open source and documented — including architecture diagrams, rollback procedures, and design-decision write-ups.