Advanced ArgoCD Features

When Basic Sync Wasn't Enough

We had a complex application: database migration β†’ schema update β†’ API deployment β†’ cache warming.

Using basic ArgoCD sync, everything deployed at once:

Time 0s: All resources created simultaneously
β”œβ”€ Database migration Job (needs to finish first)
β”œβ”€ API Deployment (needs DB migration done)
└─ Cache warming Job (needs API running)

Result: API crashed (DB not ready), cache warming failed

I needed ordered deployment. That's when I discovered sync waves.

Then we grew to 5 clusters. Managing 5 separate Applications was tedious. ApplicationSets solved that.

Then we needed approval workflows, SSO, notifications, and multi-cluster management.

ArgoCD has advanced features for all of this. Let me show you.

Sync Waves: Ordered Deployment

Sync waves control the order in which resources are synced.

The Problem

The Solution: Sync Waves

Execution:

Sync Wave Rules

  • Lower numbers sync first (wave 1 before wave 2)

  • Default wave: 0 (if no annotation)

  • Negative waves allowed (wave -1 syncs before wave 0)

  • ArgoCD waits for wave completion before moving to next

  • Jobs must complete successfully

  • Deployments must be healthy

Complex Example

Resource Hooks: Lifecycle Actions

Hooks let you run jobs at specific points in the sync lifecycle.

Hook Types

  • PreSync - Before sync starts

  • Sync - During normal sync (default)

  • PostSync - After sync completes

  • SyncFail - If sync fails

  • Skip - Never sync (manual only)

PreSync Hook: Setup

PostSync Hook: Verification

SyncFail Hook: Rollback

Hook Delete Policies

  • HookSucceeded - Delete if hook succeeds

  • HookFailed - Delete if hook fails

  • BeforeHookCreation - Delete before creating new hook (next sync)

Sync Flow with Hooks

spinner

ApplicationSets: Managing Multiple Applications

ApplicationSet generates multiple Applications from templates.

Use Cases

  1. Multi-cluster deployments - Same app, many clusters

  2. Multi-tenant - Same app, many namespaces

  3. Monorepo apps - Many apps, one repo

Generator Types

  • List: Static list of parameters

  • Cluster: Generate per cluster

  • Git: Generate from Git directories/files

  • Matrix: Combine multiple generators

Example 1: Multi-Cluster Deployment

Result: 3 Applications created automatically.

Example 2: Git Directory Generator

Repository structure:

Result: 3 Applications auto-created: api, web, worker.

Add new app:

Example 3: Cluster Generator

Register new cluster:

Multi-Cluster Management

ArgoCD can manage applications across multiple Kubernetes clusters.

Register External Cluster

Deploy to External Cluster

Hub-Spoke Architecture

spinner

One ArgoCD instance manages all clusters.

RBAC: Role-Based Access Control

Control who can do what in ArgoCD.

Default Roles

  • role:admin - Full access

  • role:readonly - Read-only access

Custom RBAC Policy

RBAC Format:

Project-Level RBAC

SSO Integration

Integrate ArgoCD with corporate SSO.

GitHub SSO

Google SSO

Okta SSO

Notifications

Get alerts when syncs succeed/fail.

Install Notifications Controller

Configure Slack Notifications

Subscribe Application to Notifications

Key Takeaways

  1. Sync waves enable ordered deployments

    • Annotate resources with argocd.argoproj.io/sync-wave

    • Lower numbers deploy first

    • ArgoCD waits for each wave to complete

  2. Hooks add lifecycle actions

    • PreSync, Sync, PostSync, SyncFail, Skip

    • Run jobs at specific sync points

    • Useful for migrations, tests, backups

  3. ApplicationSets scale application management

    • Generate multiple Applications from templates

    • List, Cluster, Git, Matrix generators

    • Perfect for multi-cluster, multi-tenant, monorepos

  4. Multi-cluster management from single ArgoCD

    • Register external clusters

    • Hub-spoke architecture

    • Centralized control

  5. RBAC controls access

    • Define roles and policies

    • Project-level isolation

    • SSO integration for enterprise auth

  6. Notifications keep teams informed

    • Slack, email, webhook integrations

    • Trigger on sync events

    • Subscribe apps to channels

In the next article, we'll integrate GitOps with CI/CD: automated image builds, Git updates, and complete deployment pipelines with GitHub Actions.


Previous: Kustomize and Helm with ArgoCD Next: GitOps CI/CD Pipeline Integration

Last updated