Skip to content

GitOps Discipline

Git as the single source of truth for infrastructure and applications.

GitOps is an operational framework that applies DevOps best practices for infrastructure automation—version control, collaboration, compliance, and CI/CD—to infrastructure configuration. In GitOps, the entire system is described declaratively in Git, and automated processes ensure the actual state matches the desired state.

After completing this track, you will be able to:

  • Explain GitOps principles and the reconciliation model
  • Design repository strategies for different team structures
  • Implement environment promotion workflows
  • Configure drift detection and automated remediation
  • Manage secrets securely in GitOps workflows
  • Architect multi-cluster GitOps for fleet management

Before starting this track, you should:

  • Understand Kubernetes fundamentals (deployments, services, namespaces)
  • Be comfortable with Git workflows (branches, PRs, merges)
  • Have experience with YAML configuration files
  • Complete the Systems Thinking foundation track (recommended)
#ModuleComplexityTimeDescription
3.1What is GitOps?MEDIUM35-45 minGitOps principles, pull vs push, reconciliation
3.2Repository StrategiesMEDIUM35-45 minMonorepo vs polyrepo, app vs config repos
3.3Environment PromotionMEDIUM40-50 minDirectory-based promotion, progressive delivery
3.4Drift DetectionMEDIUM40-50 minTypes of drift, auto-heal vs alert strategies
3.5Secrets in GitOpsCOMPLEX50-60 minSealed Secrets, SOPS, External Secrets Operator
3.6Multi-Cluster GitOpsCOMPLEX55-65 minFleet management, bootstrapping, hub-spoke patterns

Total Time: ~4-5 hours

Module 3.1: What is GitOps?
├── Understand the four principles
├── Learn pull vs push models
└── See reconciliation in action
Module 3.2: Repository Strategies
├── Choose monorepo vs polyrepo
├── Separate app and config repos
└── Design directory structures
Module 3.3: Environment Promotion
├── Directory-based promotion
├── Image tag strategies
└── Progressive delivery patterns
Module 3.4: Drift Detection
├── Identify drift types
├── Configure detection
└── Choose remediation strategy
Module 3.5: Secrets in GitOps
├── Understand the secrets problem
├── Implement encryption patterns
└── Use external secrets stores
Module 3.6: Multi-Cluster GitOps
├── Design fleet architectures
├── Automate cluster bootstrapping
└── Implement configuration inheritance
  1. Declarative - System state is expressed declaratively
  2. Versioned and Immutable - Desired state is stored in a way that enforces immutability and versioning
  3. Pulled Automatically - Agents automatically pull desired state from the source
  4. Continuously Reconciled - Agents continuously observe and reconcile system state
AspectPush ModelPull Model (GitOps)
Who deploysCI/CD pipelineAgent in cluster
CredentialsPipeline needs cluster accessCluster only needs Git access
DriftCan occur undetectedAutomatically corrected
AuditScattered in pipeline logsCentralized in Git history
┌─────────────────────────────────────────────────────────┐
│ Git Repository │
│ (Desired State) │
└────────────────────────┬────────────────────────────────┘
│ 1. Agent polls for changes
┌─────────────────────────────────────────────────────────┐
│ GitOps Agent │
│ (ArgoCD, Flux, etc.) │
│ │
│ 2. Compare desired state vs actual state │
│ 3. If different, reconcile │
└────────────────────────┬────────────────────────────────┘
│ 4. Apply changes to cluster
┌─────────────────────────────────────────────────────────┐
│ Kubernetes Cluster │
│ (Actual State) │
└─────────────────────────────────────────────────────────┘

Foundations (Start here if new to these concepts):

Disciplines (Apply GitOps in context):

Toolkits (Deep dive into specific tools):

ToolPurpose
ArgoCDKubernetes-native GitOps controller
FluxCNCF GitOps toolkit
KustomizeConfiguration customization
HelmPackage management
Sealed SecretsEncrypt secrets for Git
SOPSSecrets encryption
External Secrets OperatorSync from external stores
  • Module 3.1: What is GitOps? - Understand principles
  • Module 3.2: Repository Strategies - Design repo structure
  • Module 3.3: Environment Promotion - Implement promotion flow
  • Module 3.4: Drift Detection - Configure detection and remediation
  • Module 3.5: Secrets in GitOps - Secure secret management
  • Module 3.6: Multi-Cluster GitOps - Scale to fleet management
Terminal window
# Developer workflow
1. git checkout -b feature/new-config
2. # Make changes to desired state
3. git commit -m "Update replica count"
4. git push && open PR
5. # PR reviewed and merged
6. # GitOps agent automatically deploys
Terminal window
# ArgoCD
argocd app list
argocd app sync <app>
argocd app diff <app>
# Flux
flux get kustomizations
flux reconcile kustomization <name>
flux diff kustomization <name>
# Sealed Secrets
kubeseal --format yaml < secret.yaml > sealed-secret.yaml
PatternWhen to Use
App-of-AppsManaging multiple related applications
Directory-per-environmentClear environment separation
Base + OverlaysConfiguration inheritance
External SecretsIntegration with secret managers
Hub-SpokeCentralized fleet management