Key takeaway
- GitOps continuous delivery explained: push vs pull deployment, Argo CD vs Flux, ML pipelines, security controls and an adoption path for Kubernetes teams.
What is GitOps and how does it differ from a normal CI/CD pipeline?
GitOps is a way of running continuous delivery in which the desired state of a system lives in Git and software agents keep the running system matching it. According to OpenGitOps, a GitOps system has its desired state expressed declaratively, stored with full version history, pulled automatically by agents and continuously reconciled against the live system.
The difference from a conventional pipeline is who applies the change. In a push pipeline the CI server runs the deployment. In GitOps an agent inside the environment compares Git with reality and closes the gap, so Git becomes the audit record and the rollback source. It sits alongside the wider DevOps process and builds on infrastructure as code, applied to cloud-native applications.
Which four principles define GitOps?
The OpenGitOps principles (version 1.0.0, read 13 November 2026) are the shortest reliable definition. They are a test you can apply to any toolchain that claims to be GitOps.
| Principle | What it means in practice | What to check in your setup |
|---|---|---|
| Declarative | The desired state is described as facts, such as Kubernetes manifests, not as scripts | Can you rebuild an environment from the repository alone? |
| Versioned and immutable | State is stored with enforced versioning and complete history | Are merges reviewed, and is history protected from rewriting? |
| Pulled automatically | Agents pull the desired state from the source | Does the cluster pull, or does an outside pipeline push into it? |
| Continuously reconciled | Agents observe actual state and try to apply the desired state | What happens when someone edits the cluster by hand? |
Kubernetes suits this model because its objects are declarative. The Kubernetes documentation describes keeping object configuration files in a directory and applying them with kubectl apply, with kubectl diff to preview changes (Kubernetes docs). GitOps agents automate that loop and add continuous comparison. For the cluster side, see our guide to Kubernetes architecture and components.
Push or pull: which GitOps deployment model should you use?
Both models start the same way: code changes build an image and update a configuration repository. They differ in what applies the change to the cluster.
| Model | How it works | Strength | Risk to manage |
|---|---|---|---|
| Push-based | A CI/CD pipeline applies manifests to the environment after a change | Simple to start, and often needed to provision cloud infrastructure | The pipeline holds deployment credentials, and it only runs on a change, so drift goes unseen unless you monitor for it |
| Pull-based | An agent in the environment compares Git with the live state and applies the difference | Credentials stay in the environment, and drift is detected and corrected | You must monitor the agent itself, because delivery stops if it stops |
Prefer pull where you can, because it matches the third and fourth OpenGitOps principles. Use push where a tool must create the cluster itself, and keep the credentials of that pipeline narrow. Whichever you choose, alert on failed reconciliation: a silent agent is the same as no deployment.
How does the GitOps workflow run from commit to cluster?
A typical Kubernetes flow separates application code from environment configuration. The steps below describe the pull-based version.
A developer opens a pull request against the application repository, and a colleague reviews it.
The merge triggers continuous integration, which tests the code, builds a container image and stores it in a registry.
The new image tag is written to the environment configuration repository, either by a person through a pull request or by an automation step.
The in-cluster agent, such as Argo CD or Flux, detects that the cluster no longer matches the repository.
The agent applies the revised manifests and reports the result. Any manual edit made to the cluster is reported or reverted, depending on configuration.
Build each image once and promote the same image through test and production environments by changing the tag in Git, rather than rebuilding for each stage. This keeps what you tested identical to what you ship.
Video: GitOps tools, pipelines and the Kubernetes operator, from XenonStack.
Argo CD or Flux: which GitOps tool fits your platform?
Both are CNCF graduated projects. The CNCF project pages show Flux graduated on 30 November 2022 and Argo on 6 December 2022 (Flux, Argo). Choose on operating model, not on popularity.
| Question | Argo CD | Flux |
|---|---|---|
| What is it? | A declarative GitOps continuous delivery tool for Kubernetes that runs as a controller and compares live state with Git (docs) | A set of controllers, the GitOps Toolkit, with sources, Kustomize, Helm, notification and image automation controllers (docs) |
| How do you see state? | Reports applications as OutOfSync and visualises the differences | Reconciles Kustomization and HelmRelease resources, with notifications for alerts |
| Drift handling | Automated sync does not revert live changes unless self-heal is enabled; prune is also off by default | Manual changes made with kubectl are reverted by Kustomization reconciliation; the default interval is five minutes |
| Multi-tenancy | RBAC policies and SSO through OIDC, SAML 2.0 and other providers | Impersonation of a tenant service account so a tenant repository is not reconciled as cluster-admin |
| Fits when | You want a central view of many applications and clusters | You want small composable controllers and registry-driven image updates |
Sources: Argo CD automated sync, Flux concepts and Flux security. Helm charts can be deployed by either tool; see what Helm is and how it packages Kubernetes applications.
How do you manage many applications and clusters with GitOps?
Argo CD documents an app-of-apps pattern in which one application creates other applications, so a group of apps can be managed and deployed together (declarative setup). For many clusters, the ApplicationSet controller, bundled with Argo CD since version 2.3, generates applications from a template using list, cluster or Git generators (ApplicationSet docs). Either approach means you maintain a small set of definitions instead of one Helm chart per application.
Keep one repository layout rule: separate application source from environment configuration, and make each environment a directory or branch you can review on its own. Promotion then becomes a reviewed change in Git.
How does GitOps apply to machine learning pipelines?
GitOps controls the deployment of an ML service the same way it controls any workload: the serving manifests, image tags and configuration live in Git. What differs is that a model also depends on data and trained artefacts that are too large for Git. Tools such as DVC keep small metafiles in Git that point to data held in a cache or remote storage such as S3 or Google Cloud Storage, so a Git commit can identify an exact data and model version (DVC docs). See also implementing DevOps for machine learning.
Progressive delivery suits models, because a new version can be wrong in ways unit tests do not catch. Two Kubernetes tools fit into a GitOps flow:
| Strategy | What it does | Tool support (according to its docs) |
|---|---|---|
| Blue-green | Runs the new version beside the current one, lets you test a preview, then promotes it | Argo Rollouts uses a preview service and an active service |
| Canary | Moves traffic to the new version in stages | Argo Rollouts, and Flagger, which also lists A/B testing |
| Metric-gated promotion | Checks metrics before promoting or rolling back | Argo Rollouts and Flagger can query providers such as Prometheus and Datadog |
For model-specific checks, such as accuracy on held-out data, define the metric in your own monitoring and gate promotion on it. Our post on blue-green deployment in Kubernetes covers the pattern in more detail.
What security and compliance controls does GitOps give you?
Git gives you three controls most audit questions ask for: who may change an environment, a record of every change, and an approval step. The table shows where each comes from and where it stops.
| Control | How GitOps provides it | Where it stops |
|---|---|---|
| Access control | Only people with write access to an environment repository can change that environment, and agents use their own RBAC | Argo CD ships with broad default roles, and its docs advise narrowing them to the namespaces and resources it manages |
| Audit trail | Each commit records the author and the change message | Git history shows what changed, not whether the running cluster was later edited, so keep drift reporting on |
| Approval | Protected branches and reviewed pull requests gate merges | Anyone with write access to a trusted repository can change what is deployed, so protect the branch |
| Secrets | Keep secrets out of plain manifests | Use a documented secrets approach from your tool, such as the Argo CD and Flux secrets management pages |
The security points come from the Argo CD security guide and the Flux security page above. For regulated environments, link the repository controls to your control framework as covered in continuous compliance in DevOps. Where AI agents also propose or merge changes, AgentGRC is described on its page as governance, risk and controls for agent compliance, and ElixirData keeps governed context, versioned policy and decision traces in one decision layer above AI agents.
What are the trade-offs, and when is GitOps not the right choice?
| Challenge | Why it happens | Mitigation |
|---|---|---|
| Many environments | Each environment change needs a Git change, and branches multiply | One directory per environment, templates through Helm or Kustomize, ApplicationSet for fleets |
| Rollback is not standardised | A Git revert is easy, but data migrations and dependent services are not reverted by it | Define rollback per service, and test it before you need it |
| Visibility | Git alone does not show the live state of many clusters | Use the agent dashboard and notifications, and monitor the agent |
| Drift from manual changes | Engineers change the cluster by hand in an incident | Enable drift correction, and make emergency changes through a fast-track pull request |
| Team change | Pull request workflows are new to some operations teams | Start with one service, and train on review and rollback |
GitOps is a poor fit for workloads that are not declarative, such as one-off manual administration, or for a team with a single small environment where a simple pipeline is easier to run. It also does not replace testing: it controls how a change reaches an environment, not whether the change is good. Document and static-site publishing can follow the same pattern with a CI tool, but that is ordinary continuous delivery rather than cluster reconciliation.
How do you adopt GitOps in a sequence that works?
Pick one service with a clear owner and a non-critical blast radius, and express it fully as manifests.
Separate repositories or paths for application source and environment configuration.
Install one agent (Argo CD or Flux) in a test cluster and run it in pull mode with reporting only.
Turn on automation for the test environment, then add drift correction and pruning deliberately.
Add protection: protected branches, required reviews, narrowed agent roles and alerts on failed reconciliation.
Extend to production with progressive delivery, then to more clusters with app-of-apps or ApplicationSet.
To place GitOps in the wider delivery picture, read DevOps metrics for how to measure lead time and change failure rate, and ElixirClaw for an agentic OS platform to build, orchestrate and govern AI agents and automation workflows while keeping humans in control.
To map one delivery or release decision your agents should make, and the context and policy it depends on, book a Context Workshop. See what happens in the workshop.
GitOps FAQ
What is GitOps in simple terms?
GitOps keeps the desired state of infrastructure and applications in Git, and software agents keep the running system matching it. According to OpenGitOps, the principles are declarative state, versioned and immutable storage, automatic pulling and continuous reconciliation.
Is pull-based GitOps better than push-based?
Pull-based fits the OpenGitOps principles because an agent in the environment pulls state and reconciles it, so deployment credentials stay in the environment and drift is corrected. Push-based is simpler and is still used to provision cloud infrastructure, but the pipeline holds credentials and only acts when a change is made.
Should I choose Argo CD or Flux?
Both are CNCF graduated. Argo CD gives a central application view with OutOfSync reporting, RBAC and SSO. Flux is a set of composable controllers with source, Kustomize, Helm, notification and image automation components. Pick the one that matches how your platform team wants to operate.
Does Argo CD revert manual changes to the cluster?
Only if you enable it. According to its docs, automated sync does not revert live changes unless self-heal is on, and pruning of deleted resources is off by default. Flux Kustomization reconciliation reverts manual kubectl changes unless reconciliation is suspended.
How does GitOps work for machine learning?
Serving manifests and image tags go in Git as for any workload. Large data and model artefacts are versioned by tools such as DVC, which keeps small metafiles in Git pointing to storage. Progressive delivery with Argo Rollouts or Flagger lets you test a new model version on a share of traffic.
When should we not use GitOps?
Avoid it for non-declarative, one-off administration, or where a single small environment is easier to run with a plain pipeline. GitOps controls how a change reaches an environment; it does not replace testing of the change.
Next Steps towards GitOps Processes
Talk to our experts about implementing GitOps processes in your organization. Learn how industries and different departments use declarative workflows and infrastructure as code to become operations-centric. Utilize GitOps to automate and optimize deployments, infrastructure management, and application operations, improving efficiency and reducing mean time to recovery while ensuring consistency across environments.
Follow XenonStack on LinkedIn: XenonStack on LinkedIn for new guides on agentic AI, data and platform engineering.
Explore the XenonStack platform family: ElixirData · ElixirClaw · ElixirHub · NexaStack · MetaSecure · Neural AI · AgentGRC · AgentSRE · AgentAnalyst · AgentInstruct · AgentRAI · AgentScrum · AgentSearch · AgentForce · AI Aviator · SAIF Aviator · CohortIQ · XenonStack AI · XenonStack UAE