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).