GitOps
GitOps is an operational framework that takes DevOps best practices used for application development—such as version control, collaboration, compliance, and CI/CD—and applies them to infrastructure automation. In a GitOps model, Git serves as the single source of truth for both infrastructure and applications, where the desired state of a system is defined in a repository and automatically reconciled with the actual state in the production environment.
Key Concepts
- Declarative System: The entire system—infrastructure, application, and configuration—is described declaratively in a Git repository.
- Single Source of Truth: The Git repository contains the authoritative definition of the system’s state, enabling versioning and rollback.
- Automated Reconciliation: Software agents (controllers) continuously monitor the state of the system and automatically apply changes from Git to ensure the actual state matches the desired state.
- Pull-based Model: Unlike traditional push-based CI/CD, GitOps often uses a pull-based approach where an agent inside the cluster pulls configuration changes from the repository.
- Observability and Auditability: Every change to the system is recorded in the Git history, providing a clear audit trail and simplifying compliance.
Common Patterns or Tools
- Argo CD: A declarative, GitOps continuous delivery tool for Kubernetes that automates the deployment of applications and configurations.
- Flux: A set of open and extensible continuous delivery solutions for Kubernetes, which is popular for implementing GitOps workflows.
- Infrastructure GitOps: Using tools like Terraform or Pulumi in conjunction with a GitOps controller to manage cloud infrastructure.
- Cluster Management: Using GitOps to manage the configuration and lifecycle of Kubernetes clusters across multiple environments.
- Progressive Delivery: Combining GitOps with strategies like canary releases or blue-green deployments to minimize the risk of new releases.