CI/CD to GitOps: Argo CD Workflow Patterns
Kubernetes

CI/CD to GitOps: Argo CD Workflow Patterns

  • Author :Liam K.
  • Date :March 08, 2026
  • Time :26 minutes

Many teams have solid CI pipelines but still ship risky releases: manual hotfixes, undocumented kubectl commands, and deployments that cannot be reproduced. GitOps with Argo CD addresses this directly. Git becomes the single source of truth, Argo CD enforces the desired cluster state, and every change is traceable as a commit.

This guide does not stop at "how to install Argo CD." It focuses on production-proven workflow patterns: environment promotion, drift-safe rollback strategies, security gates in CI, and clear ownership between engineering and platform teams.

1. From Traditional CI/CD to GitOps

Traditional CI/CD often pushes directly from the pipeline into the cluster. That is fast, but risky: deployment logic is hidden in CI scripts, privileges are over-scoped, and runtime reality in the cluster drifts away from the intended state over time.

In a GitOps model, responsibilities are split clearly:

  • CI builds, tests, scans, and signs artifacts.
  • A commit updates image digests or Helm values in the GitOps repository.
  • Argo CD continuously reconciles cluster state with Git.
  • Rollback means a Git revert, not emergency runtime commands.

2. Repository Strategy: Separate App Code and Environment State

A common anti-pattern is storing everything in a single repository. In practice, separation is more resilient: keep application source and build logic in one repository, and keep environment deployment state in a dedicated GitOps repository.

bash
# Example structure
app-repo/
  src/
  Dockerfile
  .github/workflows/ci.yml
gitops-repo/
  apps/
    payments/
[...]
Command truncated. Copy to view full command.

This gives developers freedom to ship features while platform and SRE teams keep strict control over promotion rules, policy enforcement, and production approvals.

3. Argo CD Building Blocks That Actually Matter

  • Projects: Restrict allowed source repos, target namespaces, and cluster resource scope.
  • Applications: Define exactly which manifests are deployed to which destination.
  • ApplicationSet: Generate many Applications dynamically, for example per cluster or tenant.
  • Sync Windows: Protect critical production windows from uncontrolled changes.
yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: payments-prod
  namespace: argocd
spec:
  project: production
  source:
[...]
Command truncated. Copy to view full command.

4. Promotion Pattern: Build Once, Promote by Digest

The most important pattern for reproducible delivery is to build an image exactly once and promote that immutable artifact through dev, stage, and prod. No rebuild per environment, no "works on stage, fails on prod" surprises.

yaml
# Avoid mutable tags like :latest
image:
  repository: ghcr.io/acme/payments
  digest: sha256:4f2a9d...c81

Promotion should happen via pull requests in the GitOps repository. Every release stays reviewable, auditable, and quickly reversible.

5. CI Workflow: Enforce Quality Before GitOps Takes Over

GitOps does not replace robust CI. CI remains the place for tests, security scanning, and compliance checks. Only after passing those gates should promotion commits be created.

yaml
name: ci
on: [push]
jobs:
  quality:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
[...]
Command truncated. Copy to view full command.

6. Progressive Delivery with Argo Rollouts

For critical services, all-at-once deployment is not enough. Canary and blue/green strategies reduce risk significantly, especially when metric-based checks can halt a rollout automatically.

  • Canary in defined stages (for example 10%, 25%, 50%, 100%).
  • Automatic analysis using Prometheus-aligned SLIs.
  • Auto-abort on rising error rate, latency, or resource saturation.

7. Security Patterns for Argo CD in Production

  • Use Argo CD SSO (OIDC) and strict team-scoped RBAC.
  • Never store plaintext secrets, use SOPS with KMS or External Secrets Operator.
  • Enforce admission policies with Kyverno or OPA as non-optional guardrails.
  • Use signed images (cosign) and, where possible, attested build pipelines.
  • Avoid direct kubectl production changes outside approved break-glass procedures.

8. Drift Management and Incident Readiness

Drift is inevitable when people operate directly in production under pressure. Enable self-heal, configure drift alerts, and document a clear break-glass process in advance.

bash
# Immediate rollback via Git
git revert <commit-with-failed-promotion>
git push origin main

# Argo CD automatically reconciles the last known-good state

9. Observable GitOps: Metrics That Matter

Without measurable outcomes, GitOps is just a tooling change. Define clear metrics and review them on a regular cadence.

  • Lead Time for Changes (commit to production).
  • Change Failure Rate (failed deployments).
  • MTTR (time to recover after incidents).
  • Deployment Frequency per service and environment.
  • Count of manual production interventions outside GitOps.

10. Common Anti-Patterns

  • A single global Argo project with broad rights for every team.
  • Image tags without digest pinning.
  • Auto-sync everywhere without sync windows or rollout strategy.
  • CI deploying directly to prod and bypassing GitOps controls.
  • No rollback runbooks, only tribal knowledge in chat threads.

11. A 30-60-90 Day Adoption Plan

Successful adoption is incremental, not heroic:

  • Day 1-30: Pilot service, baseline RBAC, separated repos, first promotion PRs.
  • Day 31-60: Security gates, drift alerts, standardized rollback runbooks.
  • Day 61-90: Progressive delivery, team onboarding, DORA-driven optimization.

12. Practical Takeaway

GitOps with Argo CD is not the goal by itself. The real value is operational discipline: reproducible releases, explicit ownership, faster recovery, and lower change risk. When build, promotion, policy, and observability are clearly separated, your delivery process becomes not just faster but materially more resilient.

"GitOps is successful when rollback is a normal commit, not an emergency meeting."

Technical Author

Technical Author - Liam K.
Liam K.

System administrator and technical writer specializing in server infrastructure, security and deployment. Creating comprehensive guides to help you master server administration.