Kubernetes Curriculum
On this page
- Gitops Principles
- 1. Architectural Concept & Deep Dive
- 2. The Four Principles of OpenGitOps (CNCF Standard)
- 3. The Core Problem Solved: Configuration Drift & Self-Healing
- What is Configuration Drift?
- Automated Self-Healing in Action
- 4. GitOps Repository Strategies: Monorepo vs Polyrepo
- Recommended Directory Structure (Kustomize Overlays)
- 5. Security Posture of GitOps
- 6. Key Takeaways
Gitops Principles
1. Architectural Concept & Deep Dive
Coined by Alexis Richardson (CEO of Weaveworks) in 2017 and formalized by the CNCF OpenGitOps Working Group, GitOps is an operating model for cloud-native applications and infrastructure that uses Git as the single source of truth for declarative state.
In traditional DevOps CI/CD pipelines, automated build agents execute commands (kubectl apply, helm upgrade, terraform apply) pushing changes into production clusters. This traditional push model suffers from configuration drift, credential sprawl, and un-audited manual modifications (kubectl edit in production).
GitOps reverses this model: an in-cluster software agent continuously pulls the desired state from Git and reconciles differences in real time.
2. The Four Principles of OpenGitOps (CNCF Standard)
To qualify as true GitOps according to the CNCF OpenGitOps standard, a system must satisfy four non-negotiable principles:
3. The Core Problem Solved: Configuration Drift & Self-Healing
What is Configuration Drift?
An on-call engineer experiences a midnight outage and runs kubectl edit deployment/payment-api to manually increase replicas or patch an environment variable.
- In traditional CI/CD, this change is unrecorded. The next scheduled build overwrites the fix, triggering a recurring outage.
- In GitOps, manual out-of-band changes are strictly prohibited or instantly overwritten.
Automated Self-Healing in Action
4. GitOps Repository Strategies: Monorepo vs Polyrepo
Recommended Directory Structure (Kustomize Overlays)
5. Security Posture of GitOps
- Firewall Inversion (Pull over Push):
- In traditional CI/CD (Jenkins, GitLab CI, GitHub Actions), the CI server requires full
cluster-admincredentials and an open firewall port into your Kubernetes API. - In GitOps, the in-cluster operator initiates outbound read-only HTTPS connections to GitHub. The cluster API can be 100% private with zero inbound ports open!
- In traditional CI/CD (Jenkins, GitLab CI, GitHub Actions), the CI server requires full
- Cryptographic Signatures & Approvals:
- All production deployments must pass through Git Pull Requests.
- Branch protection rules enforce required reviews, signed GPG commits, and successful CI testing before merges.
- The Git commit history forms an immutable, tamper-proof SOC 2 audit log.
6. Key Takeaways
- GitOps establishes Git as the single source of truth for both infrastructure and applications.
- Built on four CNCF principles: Declarative, Versioned, Pulled Automatically, and Continuously Reconciled.
- In-cluster operators continuously monitor and eliminate configuration drift via automated self-healing.
- Inverts traditional security by pulling changes outbound, allowing Kubernetes API servers to remain entirely private.