GitOps
GitOps is a methodology for managing infrastructure and application deployments in which a Git repository serves as the single source of truth for the desired state of the whole system. Every piece of configuration — servers, networks, services, application manifests — is declared in version-controlled files, and dedicated tooling automatically brings the real environment in line with what the repository describes.
What GitOps is built on
The approach rests on a few core principles:
- Declarative model — the entire system is described as a desired end state rather than a sequence of steps to execute, in line with Infrastructure as Code;
- Versioning — change history, code review and instant rollback follow naturally from Git's nature;
- Automatic reconciliation — an operator, such as Argo CD or Flux, continuously compares the cluster's state with the repository and closes any gap;
- Self-healing — if someone modifies the environment by hand, the mechanism restores the configuration declared in Git.
In practice, a change is introduced through a pull request. Once it is approved and merged, the operator detects the new target state and rolls it out with no manual intervention from an administrator.
Practical application
GitOps is most often used with Kubernetes, where YAML manifests fit the declarative model perfectly. DevOps teams gain full auditability — every production change has its own commit, author and rationale, which simplifies compliance and security requirements.
The methodology also shines when managing multiple environments (dev, staging, production) from a single repository and when rebuilding an entire infrastructure after a disaster — you simply point the operator at the repository and the environment is recreated in a consistent, reproducible state. That makes GitOps attractive for managed server and cluster operations as well.
Powiązane pojęcia
Najczęstsze pytania
How does GitOps differ from classic CI/CD?
Classic CI/CD usually pushes changes to a server, running deployment scripts (a push model). GitOps works on a pull model: a dedicated operator inside the cluster watches the repository and reconciles the environment to match what is described in Git. The repository stays the single source of truth.
