What Is GitOps? Principles, Benefits, and How It Works

With GitOps, you can roll back your cluster with git revert and explain each approved change through a commit log. Routing normal changes through Git and running an in-cluster agent that detects drift from the repository gives infrastructure changes the same review and rollback discipline as application code, and Git preserves their history.

This guide covers the four GitOps principles, the pull-based reconciliation workflow, and the tools and practices you need to get started.

What Is GitOps?

The term GitOps blends “Git” and “operations,” and it names an operational model where a Git repository holds the declarative desired state of your infrastructure and applications while an agent running inside the target environment continuously pulls that state and applies it.

Git acts as the single source of truth, which means any change missing from the repository stays outside the approved cluster state.

Teams often describe their setup with the phrase “we keep our config in Git,” which usually points to a continuous integration and continuous delivery (CI/CD) pipeline that reads from a repository without the agent that handles the reconciliation work.

Weaveworks coined the term in a 2017 post that described GitOps as using developer tooling to drive operations. Storing manifests in Git leaves a gap between the desired state in source control and the current state in the live system, and closing that gap is what the agent exists to do. After Weaveworks closed in 2024, stewardship of the definition passed to the Cloud Native Computing Foundation (CNCF) OpenGitOps working group.

The Four GitOps Principles

The OpenGitOps working group operates under the CNCF App Delivery Special Interest Group and published the principles as OpenGitOps v1.0.0. The group produced them with 34 co-authors and input from more than 60 companies, with founding members including Amazon, Azure, GitHub, Red Hat, and Weaveworks.

The four principles fall into two halves. The first half covers how you describe and store the desired state, which the Declarative and Versioned and Immutable principles address through your repository and its commit history. The second half covers how that state reaches the cluster and stays there, which the Pulled Automatically and Continuously Reconciled principles address through the in-cluster agent.

Storing configuration in a repository satisfies the first two principles, and running an agent that watches and applies that state satisfies the other two.

Declarative

To manage a system with GitOps, you must express its desired state declaratively. You describe what should exist, a Deployment with three replicas, and the tooling works out how to get there.

An imperative kubectl scale deployment checkout --replicas=5 changes the cluster but leaves no artifact a controller can compare against later; a manifest with replicas: 5 does. Kubernetes manifests, Helm charts, Kustomize overlays, Terraform files, and other declarative formats all qualify.

Versioned and Immutable

Principle two requires a state store that enforces immutability and versioning and retains a complete version history. In Git, each desired-state commit records its author and timestamp. The diff captures the change, while your pull request policy can add a reviewer and approval record.

git revert handles rollback: you revert the commit, and the agent applies the previous known-good state at its next reconciliation. The v1.0.0 glossary calls the repository a “state store” and notes that Git is the canonical example, but teams can use any other system that meets these criteria.

Pulled Automatically

Principle three requires software agents to pull the desired state declarations from the source automatically. Argo CD and Flux are the two CNCF graduated reconciliation engines that implement this pattern for Kubernetes, and both run inside the cluster and fetch from the repository, which lets your CI system avoid credentials that can apply cluster changes.

A push-based approach creates a god-mode scenario in which the CI/CD pipeline holds credentials for deployments. With a read-only outbound connection to Git, the agent lets you keep the cluster’s control plane off the public network.

Continuously Reconciled

The fourth principle requires software agents to observe actual system state continuously and attempt to apply the desired state. Reconciliation means ensuring the actual state of a system matches its desired state, and unlike trigger-driven CI/CD, any divergence triggers reconciliation in GitOps.

The agent treats two sources of divergence identically: a new commit changed the desired state, or someone changed the live state. The second case is configuration drift, and the agent reverts a hotfix you apply with kubectl edit at the next cycle unless you also commit the change to Git.

How GitOps Works: The Pull-Based Reconciliation Loop

A GitOps workflow runs on a loop where Git holds the desired state and an in-cluster agent works to make the live cluster match it. Every change follows the same path from a pull request to a merge commit to a reconciliation cycle, which is what turns a repository into the deployment interface for the cluster.

Say you open a pull request that bumps the checkout service’s image tag from v2.0 to v2.1 in a Kustomize overlay. A reviewer approves it, the pull request merges, and the repository now describes a state the cluster doesn’t yet have. The in-cluster operator notices the gap on its next poll, applies the diff, and reports the application as synced.

The same loop covers two situations that look different on the surface but resolve the same way. A new merge commit changes the desired state, and the agent brings the cluster forward to match. Someone runs kubectl edit against the live cluster, and the agent treats that as drift from the repository and reverts it at the next interval. Flux, one of the two reconciliation engines introduced earlier, applies this behavior to any kubectl edit/patch/delete change unless you suspend reconciliation or push the change to Git.

Pull-Based vs. Push-Based Deployment

Push-based deployment is the pre-GitOps default. A CI job authenticates to the cluster and runs kubectl apply or helm upgrade when the pipeline fires.

By itself, that model does not continuously detect deviations between the cluster and the repository between runs. It also requires the CI system to hold cluster credentials, which is the exposure the pull model removes from CI.

Multi-environment promotion works in either model, though you can model environments as directories rather than branches so that promotion becomes a file copy from envs/staging to envs/prod.

Both engines support this pattern, and Flux serves as the example here because its dependency and health-check primitives make gated promotion the most direct to configure. With Flux, you can merge an infrastructure change to staging first and promote it to production only after the cluster reconciles and passes conformance tests. Argo CD reaches the same outcome through sync waves, hooks, or its ApplicationSet controller, which coordinate the promotion across environments rather than gating it inline.

GitOps vs. DevOps: Key Differences

DevOps and GitOps sit at different levels of the delivery stack, which is why teams often adopt them together rather than choosing between them. DevOps describes the cultural and organizational shift that gets development and operations teams working from shared goals, while GitOps is a specific continuous delivery technique that runs inside that culture.

Adopting GitOps changes how the deployment step actually executes by making Git the control plane and handing continuous deployment to an in-cluster agent. It fits as one implementation choice within a broader DevOps practice.

GitOps and infrastructure as code (IaC) overlap on the declarative front but differ in scope. IaC defines desired state in files, and a workflow that stops at terraform apply still requires you or your automation to run another plan whenever you need to check for drift. Argo CD works as a two-way reconciliation engine that stays aware of changes at the destination and closes that gap by watching the live state on an interval, whereas one-way IaC automation only fires when the source changes.

Key Benefits of GitOps

The benefits follow from the four principles rather than from any particular tool. Your pull request creates a review path for infrastructure changes, while continuous reconciliation keeps checking whether the live state matches the approved state:

  • Shorter deployment cycles and recovery times: Your pull request becomes the deployment unit, so shipping a change follows the same review path as a code change. Continuous reconciliation can also shorten mean time to repair (MTTR) by making rollback a version-controlled action.
  • Rollbacks without a runbook: git revert restores the last known-good state and the agent applies it.
  • Stronger security: With a pull-based setup, no cluster credentials need to sit in CI, and the operator’s kubectl apply permissions limit what a compromised Git repository can change.
  • Audit and compliance: The Git log records the approved desired-state history for the environment, though it does not capture every transient live-state mutation. Your auditor can trace an approved ingress timeout change to a commit hash rather than a Slack thread.
  • Reduced configuration drift: Continuous reconciliation reverts one-off kubectl fixes, which forces every lasting fix into Git or out of the cluster. Teams that skip continuous reconciliation and automatic rollback also skip this benefit.
  • Self-documenting operations: The repository is the current answer to “what is running in production.”

These benefits turn your repository into a versioned record of every approved change and give the cluster a continuously enforced desired state. Git holds what your team agreed to run, and the agent keeps checking the live environment against that record so approvals and reality stay in step.

GitOps Tools

The tooling splits into three layers, and only the first is GitOps-specific. Argo CD and Flux provide the reconciliation layer. Both engines are CNCF graduated projects:

  • Argo CD: Argo CD watches one or more repositories, compares rendered manifests with live cluster state, marks applications OutOfSync when they differ, and syncs automatically or on approval.
  • Flux: Flux uses a set of controllers, the flux command-line interface (CLI), and Git; it reconciles GitRepository, Kustomization, and HelmRelease resources and manages its own installation from Git.
  • Configuration tools: Helm templates charts and Kustomize patches base manifests with per-environment overlays, and their rendered output is what the engine applies. A kustomize edit set image command in a CI step is the typical way a new build enters the repository.
  • Git hosting: GitHub, GitLab, or any standard Git host works, since the engines need repository access, any required credentials, and optionally a webhook endpoint for faster notifications.

These layers separate reconciliation from manifest rendering and repository hosting. The two engines differ on defaults more than on model.

The table below compares their default reconciliation intervals, drift correction behavior, interfaces, and self-management approaches. Which interface and reconciliation settings you prefer will usually drive the choice.

Argo CDFlux
Default reconcile intervaltimeout.reconciliation controls polling, with jitter affecting the timingKustomization runs every five minutes, and .spec.interval sets the interval
Drift correction defaultYou opt in with selfHeal: true, prune: trueFlux reverts drift without extra configuration
InterfaceWeb interfaceflux CLI and Git
Self-managementYou install it from a pinned manifestFlux manages its own installation via flux bootstrap

How to Get Started with GitOps

Getting a GitOps pipeline into a working state on Kubernetes takes a handful of concrete steps, and each one maps to a decision the engines expect you to have made before they can reconcile anything.

The sequence below moves from the underlying platform to a single running application, and then to the growth patterns that keep the pipeline manageable as more teams and clusters come online:

  1. Provision a Kubernetes cluster and a Git repository for manifests. You may keep the manifest repository separate from application source so that config changes flow through their own review path.
  2. Install one of the two reconciliation engines in the cluster. Argo CD installs into its own namespace from the published manifest, and you should consider pinning a version for production. The Flux bootstrap installation commits Flux’s own manifests to your repository so every later change, including Flux upgrades, goes through a Git push.
  3. Point the engine at a directory holding one application and turn on automated sync. This gives you a full end-to-end loop against a small surface area before you widen the scope.
  4. Move to a directory-per-environment layout once the single-application setup is stable. Promotion between environments then becomes a file copy from envs/staging to envs/prod under the same review process.
  5. Adopt Argo CD’s ApplicationSet controller or Flux’s multi-tenancy configuration when several teams or clusters share the pipeline. Both patterns let you template application definitions across environments and tenants without duplicating manifests.

Readiness for any of this comes back to Principle one. If you still apply anything by hand or by script, you have to convert it to declarative state before the engine has something to reconcile against.

GitOps pipelines manage what you deploy, and Coralogix covers how it behaves and watches post-deploy telemetry data for drift-related regressions across logs, metrics, and traces. That lets you manage desired state and runtime behavior through complementary workflows.

GitOps Tracks What Deployed; Telemetry Shows How It Ran

A healthy status in Argo CD means the resources exist and report readiness, which is a narrower claim than most teams read into it. Successful responses from the checkout path require separate runtime verification, and a bad change can auto-sync to production while every health check passes. Closing that gap means correlating deploy commits with telemetry data, and the OpenTelemetry (OTel) CI/CD conventions include a commit revision attribute for tagging telemetry with the commit that shipped it.

Once telemetry carries the commit that shipped it, an observability layer can turn a live regression back into a specific change in Git.

Olly, Coralogix’s autonomous observability agent, cross-references live system behavior with the code changes in Git and runs root cause analysis down to the line that caused the regression. Pairing a GitOps pipeline with Kubernetes monitoring lets you tell a bad deploy from a bad reconciliation, then line up latency spikes with nearby pipeline events and Git activity such as commits or pushes. Deployment markers add context when your pipeline sends those events to Coralogix.

Start a free 14-day Coralogix trial and point it at a GitOps-managed cluster to see the same commit hash that Argo CD or Flux synced show up alongside the logs, metrics, and traces from the workloads it deployed.

Frequently Asked Questions About GitOps

What is the difference between GitOps and Jenkins?

Jenkins is a continuous integration tool that builds, tests, and publishes artifacts; in a push-based pipeline it also runs the deploy step against the cluster. GitOps moves that step inside. Jenkins commits the new image tag to the config repository, and Argo CD or Flux syncs it.

What are the four principles of GitOps?

The four principles are Declarative, Versioned and Immutable, Pulled Automatically, and Continuously Reconciled. A pipeline that stores manifests in Git and never watches the cluster meets half the definition.

Does GitOps only work with Kubernetes?

GitOps also works outside Kubernetes. Its principles apply to any infrastructure that you can observe and describe declaratively. Non-Kubernetes targets can rely on the Tofu Controller for Terraform or Crossplane for cloud resources, both of which still run inside a Kubernetes cluster.

What is Argo CD and how does it relate to GitOps?

Argo CD is a CNCF graduated continuous delivery tool that implements pull-based GitOps for Kubernetes: it watches a repository, diffs the desired manifests against live cluster state, and applies the difference. Flux provides the main alternative with the same reconciliation model.

How does GitOps handle secrets?

You should never commit plaintext secrets to Git. Common patterns include encrypting secrets in the repository with Sealed Secrets or another encryption tool, or storing them in an external manager such as HashiCorp Vault and syncing them in with the External Secrets Operator. You should prefer destination-cluster secrets rather than injecting them during manifest generation, since generated manifests sit in plaintext in Argo CD’s Redis cache.

DevSecOps vs DevOps: What are the Differences?

The modern technology landscape is ever-changing, with an increasing focus on methodologies and practices. Recently we’re seeing a clash between two of the newer and most popular players: DevOps vs DevSecOps. With new methodologies come new mindsets, approaches, and a change in how organizations run. 

What’s key for you to know, however, is, are they different? If so, how are they different? And, perhaps most importantly, what does this mean for you and your development team?

In this piece, we’ll examine the two methodologies and quantify their impact on your engineers.

DevOps: Head in the Clouds

DevOps, the synergizing of Development and Operations, has been around for a few years. Adoption of DevOps principles has been common across organizations large and small, with elite performance through DevOps practices up 20%.

The technology industry is rife with buzzwords, and saying that you ‘do DevOps’ is not enough. It’s key to truly understand the principles of DevOps.

The Principles of DevOps

Development + Operations = DevOps. 

There are widely accepted core principles to ensure a successful DevOps practice. In short, these are: fast and incremental releases, automation (the big one), pipeline building, continuous integration, continuous delivery, continuous monitoring, sharing feedback, version control, and collaboration. 

If we remove the “soft” principles, we’re left with some central themes. Namely, speed and continuity achieved by automation and monitoring. Many DevOps transformation projects have failed because of poor collaboration or feedback sharing. If your team can’t automate everything and monitor effectively, it ain’t DevOps. 

The Pitfalls of DevOps

As above, having the right people with the right hard and soft skills are key for DevOps success. Many organizations have made the mistake of simply rebadging a department, or sending all of their developers on an AWS course and all their infrastructure engineers on a Java course. This doesn’t work – colocation and constant communication (either in person, via Slack or Trello) are the first enablers in breaking down silos and enabling collaboration. 

Not only will this help your staff cross-pollinate their expertise, saving on your training budget, but it enables the organic and seamless workflow. No two organizations or tech teams are the same, so no “one size fits all” approach can be successfully applied.

DevSecOps: The New Kid On The Block

Some people will tell you that they have been doing DevSecOps for years, and they might be telling the truth. However, DevSecOps as a formal and recognized doctrine is still in its relative infancy. If DevOps is the merging of Development and Operations, then DevSecOps is the meeting of Development, Security, and Operations. 

Like we saw with DevOps adoption, it’s not just as simple as sending all your DevOps engineers on a security course. DevSecOps is more about the knowledge exchange between DevOps and Security, and how Security can permeate the DevOps process. 

When executed properly, the “Sec” shouldn’t be an additional consideration, because it is part of each and every aspect of the pipeline.

What’s all the fuss with DevSecOps?

The industry is trending towards DevSecOps, as security dominates the agenda of every board meeting of every big business. With the average cost of a data breach at $3.86 million, it’s no wonder that organizations are looking for ways to incorporate security at every level of their technology stack.

You might integrate OWASP vulnerability scanning into your build tools, use Istio for application and container-level security and alerting, or just enforce the use of Infrastructure as Code across the board to stamp out human error.

However, DevSecOps isn’t just about baking Security into the DevOps process. By shifting security left in the process, you can avoid compliance hurdles at the end of the pipeline. This ultimately allows you to ship faster. You also minimize the amount of rapid patching you have to do post-release, because your software is secure by design.

As pointed out earlier, DevOps is already a successful methodology. Is it too much of a leap to enhance this already intimidating concept with security as well? 

DevOps vs DevSecOps: The Gloves Are Off

What is the difference between DevOps and DevSecOps? The simple truth is that in the battle royale of DevOps vs DevSecOps, the latter, newer, more secure contender wins. Not only does it make security more policy-driven, more agile, and more enveloping, it also bridges organizational silos that are harmful to your overall SDLC.

The key to getting DevSecOps right lies in two simple principles – automate everything and have omnipotent monitoring and alerting. The reason for this is simple – automation works well when it’s well-constructed, but it still relies on a trigger or preceding action to prompt that next function. 

Every single one of TechBeacon’s 6 DevSecOps best practices relies on solid monitoring and alerting – doesn’t that say a lot?

Coralogix: Who You Want In Your Corner

Engineered to support DevSecOps best practices, Coralogix is the ideal partner for helping you put security at the center of everything. 

Alerts API allows you to feed ML-driven DevOps alerts straight into your workflows, enabling you to automate more efficient responses and even detect nefarious activity faster. Easy to query log data combined with automated benchmark reports ensure you’re always on top of your system health. Automated Threat Detection turns your web logs into part of your security stack. 

With battle-tested software and a team of experts servicing some of the largest companies in the world, you can rely on Coralogix to keep your guard up.

Where is Your Next Release Bottleneck? 

A typical modern DevOps pipeline includes eight major stages, and unfortunately, a release bottleneck can appear at any point:

devops pipeline

These may slow down productivity and limit a company’s ability to progress. This could damage their reputation, especially if a bug fix needs to be immediately deployed into production.

This article will cover three key ways using data gathered from your DevOps pipeline can help you find and alleviate bottlenecks in your DevOps pipeline.

1. Increasing the velocity of your team

To improve velocity in DevOps, it’s important to understand the end-to-end application delivery lifecycle to map the time and effort in each phase. This mapping is performed using the data pulled directly and continuously from the tools and systems in the delivery lifecycle. It helps detect and eliminate bottlenecks and ‘waste’ in the overall system. 

Teams gather data and metrics from build, configuration, deployment and release tools. This data can contain information such as release details, duration of each phase, whether the phase is successful and more. However, none of these tools paint the whole picture.

By analyzing and monitoring this data in aggregate, DevOps teams benefit from an actionable view of the end-to-end application delivery value stream, both in real-time and historically. This data can be used to streamline or eliminate the bottlenecks that are slowing the next release down and also enable continuous improvement in delivery cycle time.

2. Improving the quality of your code

Analyzing data from the testing performed for a release, enables the DevOps teams to see all the quality issues in new releases and remediate them before implementing into production. Ideally preventing post-implementation fixes.

In modern DevOps environments, most (if not all) of the testing process is achieved with automated testing tools. Different tools are usually used for ‘white box’ testing versus ‘black box’ testing. While the former aims to cover code security, dependencies, comments, policy, quality, and compliance testing, the latter covers functionality, regression, performance, resilience, penetration testing, and meta-analysis like code coverage and test duration.

Again, none of these tools paints the whole picture, but analyzing the aggregate data enables DevOps teams to make faster and better decisions about overall application quality, even across multiple QA teams and tools. This data can even be fed into further automation. For example:

  • Notify the development team of failing code which breaks the latest build. 
  • Send a new code review notification to a different developer or team.
  • Push the fix forward into UAT/pre-prod.
  • Implement the fix into production.

There are some great static analysis tools that can be integrated into the developers’ pipeline to validate the quality, security, and unit test coverage of the code before it even gets to the testers. 

This ability to ‘shift left’ to the Test stage in the DevOps loop (to find and prevent defects early) enables rapid go/no-go decisions based on real-world data. It also dramatically improves the quality of the code that is implemented into production, by ensuring failing or poor quality code is fixed or improved. Therefore reducing ‘defect’ bottlenecks in the codebase. 

3. Focusing in on your market

Data analytics from real-world customer experience enables DevOps teams to reliably connect application delivery with business goals. It is critical to connect technology and application delivery with business data. While technical teams need data on timings like website page rendering speeds, the business needs data on the impact of new releases.

This includes metrics like new users / closed accounts, completed sales/items stuck in the shopping cart and income. No single source provides a complete view of this data, as it’s isolated across multiple applications, middleware, web servers, mobile devices, APIs, and more.

Fail Fast, Fail Small, Fail Cheap!

Analyzing and monitoring the aggregate data to generate business-relevant impact metrics enables DevOps teams to:

  • Innovate in increments 
  • Try new things
  • Inspect the results
  • Compare with business goals
  • Iterate quickly

Blocking low-quality releases can ultimately help contain several bottlenecks that are likely to crop up further along in the pipeline. This is the key behind ‘fail fast, fail small, fail cheap’, a core principle behind successful innovation.

Bottlenecks can appear in a release pipeline. Individually, many different tools all paint part of the release picture. But only by analyzing and monitoring data from all these tools can you see a full end-to-end, data-driven approach that can assist in eliminating bottlenecks. This can improve the overall effectiveness of DevOps teams by enabling increased velocity, improved code quality and increased business impact.