You now know ALL the tools. The final skill: knowing WHEN to use which one. This lesson is a collection of decision frameworks — the judgment that makes someone a senior DevOps architect rather than a tool operator.

Decision 1: Push CD vs GitOps

Choose Push-Based CD when: • Non-K8s targets (VMs, App Service, Lambda) • Team < 5, few services (simplicity wins) • No drift concern (ephemeral envs) • Just getting started (learn first) → GitHub Actions + azure/webapps-deploy Choose GitOps when: • Kubernetes (it's the natural fit) • Multiple services / environments • Compliance / audit trail needed • Multi-cluster / multi-team → ArgoCD + GitOps repo + PR promotion

Decision 2: Helm vs Kustomize

HelmKustomize
Choose whenComplex templating, many parameters, shared charts across teamsSimple overlays, no template logic, pure K8s YAML
Learning curveHigher (Go templates, chart structure)Lower (just patches on base YAML)
PackagingVersioned chart in registryJust directories in Git
ArgoCD supportNativeNative
Rollbackhelm rollback (built-in history)git revert (Git is the history)
Architect's rule of thumb: Start with Kustomize (simpler). Graduate to Helm when you need: versioned chart packaging, complex conditionals, or shared charts across multiple teams/repos.

Decision 3: Deployment Strategy

Service TypeStrategyWhy
Internal API, low trafficRolling UpdateSimple, zero-downtime, K8s default
User-facing, high trafficCanary (Argo Rollouts)Limit blast radius, automated validation
Database migration requiredBlue-GreenAtomic switch, easy rollback, no mixed versions
Dev/preview environmentsRecreateFast, simple, downtime acceptable

Decision 4: Mono-Repo vs Multi-Repo

Mono-RepoMulti-Repo
Best forTightly coupled services, shared libs, small teamIndependent services, large org, clear ownership
CI complexityHigher (path filtering, change detection)Lower per repo (but many repos to manage)
Shared codeDirect imports (same repo)Published packages (npm, etc.)
GitOps repoOne GitOps repo, many pathsOne GitOps repo (or one per cluster)

Decision 5: When to Auto-Deploy vs Gate

EnvironmentAuto-Deploy?Gate Type
Dev/Preview✅ AlwaysNone — fail fast
Staging✅ AlwaysSmoke test (automated)
Production (low-risk)✅ With canaryAutomated analysis
Production (high-risk)❌ PR-basedHuman review + merge
Compliance/regulated❌ NeverMulti-party approval + audit

The Complete Architecture (What You Can Now Build)

┌───────────────────────────────────────────────────────────────────────────┐ │ YOUR PRODUCTION CI/CD ARCHITECTURE │ ├───────────────────────────────────────────────────────────────────────────┤ │ │ │ ┌──────────────┐ ┌──────────────────────┐ ┌──────────────────┐ │ │ │ App Repo │─CI─▶│ GitHub Actions │─────▶│ ACR │ │ │ │ (src, test) │ │ test → build → sign │ │ (signed images) │ │ │ └──────────────┘ └──────────┬───────────┘ └──────────────────┘ │ │ │ │ │ update image tag │ │ │ │ │ ┌──────────────┐ ▼ │ │ │ GitOps Repo │◀────── commit / PR │ │ │ (Kustomize) │ │ │ └──────┬───────┘ │ │ │ ArgoCD watches │ │ ▼ │ │ ┌──────────────────────────────────────────────────────────────────────┐ │ │ │ AKS Cluster │ │ │ │ ┌──────────┐ ┌──────────────┐ ┌─────────┐ ┌──────────────────┐ │ │ │ │ │ ArgoCD │ │ Argo │ │ Gate- │ │ External │ │ │ │ │ │ (sync) │ │ Rollouts │ │ keeper │ │ Secrets (ESO) │ │ │ │ │ └──────────┘ │ (canary) │ │ (policy)│ └──────────────────┘ │ │ │ │ └──────────────┘ └─────────┘ │ │ │ │ │ │ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ │ │ staging │ │ production │ │ preview │ │ │ │ │ │ (auto-sync) │ │ (PR-based) │ │ (per-PR) │ │ │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ │ └──────────────────────────────────────────────────────────────────────┘ │ │ │ │ Security: OIDC auth │ Signed images │ Policies │ No stored secrets │ │ Speed: Caching │ Parallelism │ Concurrency cancel │ Layer cache │ │ Reliability: Atomic deploys │ Self-heal │ Auto-rollback │ DR via Git │ │ │ └───────────────────────────────────────────────────────────────────────────┘

🧠 Final Recall Check

As an architect, answer these scenario questions:

  1. A startup with 3 devs, 1 service, deploying to Azure App Service. What CI/CD approach?
  2. A fintech company with 20 microservices on AKS, strict audit requirements. What approach?
  3. Your canary is showing 3% error rate (baseline is 1%). What happens automatically?
  4. Someone accidentally deletes the production namespace. How fast can you recover with GitOps?
  5. You need to roll back the last production deploy. What do you do?
Reveal answers
  1. Simple push-based CD. GitHub Actions → test → deploy to App Service with OIDC. Add Environments for staging/production approval. Don't over-engineer with GitOps for 1 service.
  2. Full GitOps. ArgoCD + ApplicationSet + PR-based promotion + image signing + Gatekeeper policies + External Secrets. Audit trail = Git history. Compliance = signed images + admission control.
  3. Argo Rollouts auto-rollback. The AnalysisTemplate detects error rate > threshold → rollout aborted → traffic returns to stable version. Zero human intervention.
  4. Minutes. ArgoCD's self-heal detects the drift and recreates everything in that namespace from Git. If ArgoCD itself is gone: reinstall ArgoCD → apply root app → everything syncs back.
  5. git revert <deploy-commit> in the GitOps repo (or revert the PR). ArgoCD syncs the reverted state → old image deployed. Under 5 minutes total.

🎓 What You've Mastered

You can now:
  • ✅ Design a CI/CD architecture for any team size and complexity
  • ✅ Implement GitHub Actions pipelines from simple to production-grade
  • ✅ Deploy to Azure (App Service, AKS) with zero stored credentials
  • ✅ Build, scan, sign, and push container images
  • ✅ Operate ArgoCD for GitOps delivery with progressive rollouts
  • ✅ Secure the entire pipeline (supply chain, admission, policies)
  • ✅ Optimize for speed, cost, and reliability
  • ✅ Make architectural decisions with confidence and defend them

You're ready to be the person who designs the pipeline architecture for your team. 🎉