DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workloads.

Trending

  • Docker Base Images Demystified: A Practical Guide
  • Scaling DevOps With NGINX Caching: Reducing Latency and Backend Load
  • Building an AI/ML Data Lake With Apache Iceberg
  • Driving DevOps With Smart, Scalable Testing
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. GitOps: What Is It and How Does It Work?

GitOps: What Is It and How Does It Work?

GitOps: the single source of truth, the converter of as-code, and the bringer of CI/CD automation. Get an intro view into GitOps here!

By 
Pavan Belagatti user avatar
Pavan Belagatti
DZone Core CORE ·
Mar. 24, 22 · Opinion
Likes (3)
Comment
Save
Tweet
Share
3.2K Views

Join the DZone community and get the full member experience.

Join For Free

Over the years, software development methodologies have changed from the waterfall model, to agile, to what we call DevOps today. Even though these methodologies focus mostly on cultural aspects, they are all backed by powerful tools and technologies that make the work more straightforward than before. Just as Docker and Kubernetes boosted DevOps adoption by making containerization easier for organizations, we are now witnessing GitOps gain traction but with Git at the center of the approach. 

This article will explore GitOps: Why is it used? How does it work? 

Why GitOps?

Today, many enterprises are embracing this new method of versioning their infrastructure and apps. GitOps helps engineering teams respond to issues faster and make fixes quicker, leading to more agile deployments. A significant benefit is that all changes can be tracked through history, making debugging and rolling back easier. It also allows you to make changes more quickly and improves collaboration by letting others know what you are doing during the deployment process. In addition, the deployments are easy to reverse if something goes wrong. 

With GitOps, if you are unsure or something doesn’t work, you don’t have to debug the issue by going through complex logs; you can simply go to your commit history to see everything clearly and also roll back to the previously known stable release.

GitOps reduces some complexity by leveraging Git at the center of the delivery pipelines. Instead of learning a new shiny tool, developers can leverage their knowledge of Git commands. 

How Does it Work?

Many organizations struggle to release new features because of complex release processes that increase downtime and affect developer morale. Deploying hundreds of features that take many hours to deploy overnight doesn’t help either – GitOps is a way to manage such deployments by automating the heavy lifting required without mishaps.

The central idea of GitOps is to keep your project code in a Git repo (application code, the files, dependencies, manifests, etc.) and sync the state of the repo with the state of the Kubernetes cluster. For this to succeed, an agent keeps track of the manifest file changes or whenever a developer pushes new code. The agent can see what changed and sync it to match the expected/desired state. 

GitOps works on two models – push and pull. The push-based approach is where your CI/CD tool will push the changes to the production environment. The pull-based method requires an agent to be installed in every cluster. It keeps track of the changes and pulls them in whenever there is a mismatch from the required configuration. FluxCD, Argo CD, and JenkinsX are the three major platforms that pioneered the GitOps space. 

GitOps

Let’s assume that you have a Git repository with all your application code and a properly configured CI pipeline. When a developer pushes new code to GitHub, it gets verified, and a CI server checks and builds the code by running the specified tests to see if everything is good. Next, a container image is created and pushed to an image registry. The new change gets pulled/picked by the Git operator and scans it to see if the current and desired state match. If the current and desired state doesn’t match, then it gets provisioned to maintain the desired state. Finally, the deployment happens. 

GitOps vs DevOps: What’s the Difference?

Both DevOps and GitOps promote the ease of deploying software at their core, but they differ in how they operate. Let us see how they compare with each other. 

  • GitOps fits under the automation principle of DevOps. It helps companies incrementally deploy software often and with speed. 
  • While DevOps focuses on breaking the silos between Dev and Ops, GitOps focuses on intelligent and automated Ops. 
  • DevOps promotes CI/CD automation with a push-based approach, whereas GitOps predominantly promotes Continuous Delivery with the pull-based approach.
  • DevOps involves both declarative and imperative approaches for deployment, whereas GitOps enables declarative IaC.
  • GitOps centralizes its focus on Git as the prominent tool. In contrast, DevOps doesn’t focus on tools. Instead, it focuses on the cultural aspect to boost collaboration between Dev and Ops. 
  • GitOps tends to be more developer-centric as it makes deploying easy by involving tools such as Git and Kubernetes. In contrast, DevOps can’t be described with any particular tool as it is a methodology across the organization.
  • The scope of DevOps is not limited just to CI/CD and the correctness of software delivery. In contrast, the primary focus of GitOps is on continuously delivering software the right way. 

Conclusion

When looking at GitOps, it is evident that it has numerous advantages. It helps developers and DevOps engineers automate the software delivery process. It does this by moving software from development to testing, staging, and finally to production. Developers already love this approach, and it seems like GitOps will continue to grow in popularity in the cloud-native space. 

One concerning point of GitOps today is it lacks a full-blown end-to-end tool/platform so organizations can use it as a standard approach. Hence, to make it a new reality, Harness recently introduced Harness GitOps, which incorporates highly sophisticated CI and CD capabilities.

Published at DZone with permission of Pavan Belagatti, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!