What is GitOps and how does it differ from traditional push-based CD?
Answer
GitOps is a CD approach where the desired state of infrastructure and applications is declared in Git, and a reconciliation agent automatically detects drift and applies changes to match the Git state. Tools like ArgoCD and Flux continuously watch a Git repository for changes and apply them to the Kubernetes cluster. In push-based CD (traditional), the CI pipeline directly runs kubectl apply or helm upgrade against the cluster when code changes. In GitOps (pull-based), the pipeline only updates the Git repository (e.g., a Helm values file with the new image tag), and the GitOps agent running inside the cluster detects the change and pulls and applies it. Benefits of GitOps: the Git repo is the single source of truth, all changes have a full audit log (git history), rollback is git revert, and the cluster credentials never leave the cluster (no need to give CI systems access to production Kubernetes).
Previous
What is Helm and how is it used in CD pipelines?
Next
What is environment promotion and how does it work in practice?
More CI/CD Pipelines Questions
View all →- Intermediate What is blue-green deployment and how does it achieve zero-downtime releases?
- Intermediate What is a canary release and how does it reduce deployment risk?
- Intermediate What is a rolling deployment and how does it compare to blue-green?
- Intermediate What are feature flags and how do they integrate with CI/CD?
- Intermediate What is the testing pyramid in CI/CD and where does each test type run?