GitOps the Hard Way, with Argo CD — book cover

What You'll Learn

About This Book

The hard way means building every piece yourself instead of letting a script, a managed service or a one-click installer do it somewhere you cannot watch. You provision the servers with Terraform, bootstrap the Kubernetes cluster, install Argo CD from raw manifests, register the repository, and see the first sync fire because you wired it. Every component passes through your hands once, which is why you recognize it later when it misbehaves.

The course starts from an empty cluster and ends with commits that reconcile onto it while your hands stay off the keyboard. In between: the Argo CD components and what breaks when each one is unhealthy, Application manifests read field by field, sync policy set on purpose — automated sync, self-healing, pruning and its exceptions, retries and backoff, ignoreDifferences — resource hooks and sync waves, projects and RBAC, ApplicationSets across clusters, and Helm charts managed as versioned releases.

Table of Contents

  1. Why This Book Exists
    • Who This Guide Is For
    • What You Will Learn
    • About the Author
    • Join the Community
    • Your Feedback Matters
  2. How to Get the Most Out of This Book
    • What This Book Asks of You
    • Conventions
  3. What Argo CD Actually Does: GitOps, Reconciliation, and Why Immutable Wins
    • Where Argo CD Came From, and Why That Gap Existed
    • Argo CD in One Sentence, Then the Five-Step Loop
    • Declare the Outcome, Not the Steps: The Irrigation Analogy
    • Why Servers Should Be Disposable: Entropy, Kernighan's Law, and Immutable Infrastructure
  4. Inside Argo CD: The Components and the Reconciliation Loop
    • The Seven Parts That Make Up Argo CD
    • How a Change Travels From Git to the Cluster
  5. Stand Up the Lab: Two Servers, a Cluster, and an App to Deploy
    • The Infrastructure
    • The Application
    • The Container
    • The Repository
    • The Registry
    • The Platform
  6. Install Argo CD: From kubectl apply to argocd login
    • The Four Install Methods, and When Each Fits
    • Deploying Argo CD With the Full Install
    • Reaching the Argo CD Web UI
    • Installing the Argo CD CLI
    • Configuring the Argo CD CLI
    • Logging in With a Token
    • Adding More Clusters
    • Argo CD Configuration
  7. Your First Argo CD Application: From CLI to Declarative Manifests
    • Creating an Application With the argocd CLI
    • A Better Way: Define the Same Setup as Manifests
  8. Sync Policy: Every Field, Every Sync Option, Every Annotation
    • Reading the Application Manifest Field by Field
    • Automating Synchronization
    • Spreading the Load With Jitter
    • Auto-Sync and Self-Healing
    • Pruning Resources
    • What Happens to Resources When You Delete an Application
    • Retrying Failed Sync Attempts and Backoff Strategy
    • Ignoring Differences During Sync
    • Skipping Schema Validation Before Apply
    • Syncing Only the Resources That Changed
    • Overwriting Resources Instead of Merging Into Them
    • Letting the API Server Compute the Merge
    • Failing the Sync When Two Applications Manage the Same Resource
    • Creating the Destination Namespace Automatically
    • Adding Labels and Annotations to the Application Namespace
    • Limiting How Many Sync Records Argo CD Keeps
    • A Recap Exercise
  9. Sync Phases and Hooks: Run Your Own Code Around a Sync
    • A Sync Runs in Phases
    • Your First Hook: A PostSync Smoke Test
    • Cleaning Up Hook Resources
    • The Other Phases
    • Ordering Within a Phase: Sync Waves
    • What Happens if a Hook Fails
  10. Local Users and RBAC: Give One Teammate One Project
    • "Creating a User" Is Two Unrelated Operations
    • Step 1: Create the Account
    • Step 2: Grant Rights
    • Verify the Grant Resolved
  11. Argo CD With Helm: Charts, Values, and Versioned Releases
    • Helm vs. Plain Kubernetes Resources
    • Creating a Helm Chart for Our Application
    • Deploying the Helm Chart With Argo CD
    • Understanding Helm Chart Versioning
    • Creating a Helm Package
    • Creating a Helm Repository
    • Deploying Helm Charts With Argo CD Using a Helm Repository
    • Upgrading the Helm Chart
    • Overriding the Helm Chart's Default Values
    • Using Multiple Sources for a Single Application
    • Helm Hooks vs. Argo CD Hooks
  12. ApplicationSets: Generate Applications from Templates
    • The problem ApplicationSets solve
    • Prerequisite: The CRDs
    • The ApplicationSet: a List generator
    • Doing More with the ApplicationSet
    • Practicing the ApplicationSet
  13. Multi-Branch CI/CD: One Argo CD Application Per Git Branch
    • Goal: A Live Environment for Every Branch Push
    • Design and Implementation
  14. Afterword: Where to Go From Here
    • What's Next?
    • Your Feedback Matters

Who This Is For

Kubernetes developers, platform and DevOps engineers, SREs, and teams getting off ad hoc kubectl apply.

About the Author

Aymen El Amri is a software engineer, author and founder. He runs eralabs, built FAUN.dev, and writes about cloud native systems, AI engineering and developer tooling. More about Aymen.

More by Aymen El Amri