Chapter 17: CI/CD and GitOps for Infrastructure
Word target: 3,400
Primary deliverable: Change pipeline with rollback controls
Key diagrams: Pipeline stages and promotion flow
Learning Goals
- Gate infrastructure changes with automated checks.
- Build safe promotion path from dev to live environments.
- Implement deterministic rollback for failed changes.
MVP Lab Worksheet
- Objective: Add CI checks to infra repo.
- Starting state: IaC/config repos exist.
- Steps:
- Add lint/validation jobs.
- Enforce PR-based change approvals.
- Verify failed check blocks merge.
- Evidence: CI run logs and policy config.
- Exit criteria: Unvalidated changes cannot reach main branch.
- Rollback: Temporarily disable strict gate via emergency policy.
Advanced Lab Worksheet
- Objective: Test end-to-end rollback path.
- Starting state: CI gates active.
- Steps:
- Introduce a controlled bad deploy.
- Trigger rollback workflow.
- Validate service and infra state recovery.
- Evidence: Deployment and rollback timeline.
- Exit criteria: Rollback completes inside target window.
- Rollback: Reapply last known good release tag.
Author Gap Check
Document when manual intervention is allowed and who approves it.