{"id":418194,"date":"2022-03-18T19:05:29","date_gmt":"2022-03-18T16:05:29","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/"},"modified":"2022-03-18T19:05:29","modified_gmt":"2022-03-18T16:05:29","slug":"what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/","title":{"rendered":"#What Is Agent-Based GitOps and How Does It Differ From CI\/CD? \u2013 CloudSavvy IT"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a2d830d23d6f\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a2d830d23d6f\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/#%E2%80%9CWhat_Is_Agent-Based_GitOps_and_How_Does_It_Differ_From_CICD_%E2%80%93_CloudSavvy_IT%E2%80%9D\" >&#8220;What Is Agent-Based GitOps and How Does It Differ From CI\/CD? \u2013 CloudSavvy IT&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/#Whats_An_Agent\" >What\u2019s An Agent?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/#Agent_Advantages\" >Agent Advantages<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/#What_About_Push-Based_GitOps\" >What About Push-Based GitOps?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd-cloudsavvy-it\/#Summary\" >Summary<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CWhat_Is_Agent-Based_GitOps_and_How_Does_It_Differ_From_CICD_%E2%80%93_CloudSavvy_IT%E2%80%9D\"><\/span>&#8220;What Is Agent-Based GitOps and How Does It Differ From CI\/CD? \u2013 CloudSavvy IT&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div id=\"article-content-area\">\n<figure style=\"width: 1200px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage size-full wp-image-15562\" data-pagespeed-lazy-srcset=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2022\/02\/83eb197f.jpg?width=398&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 400w, https:\/\/www.cloudsavvyit.com\/p\/uploads\/2022\/02\/83eb197f.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1 1200w\" sizes=\"auto, 400w, 1200w\" data-pagespeed-lazy-src=\"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2022\/02\/83eb197f.jpg?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Graphic showing infinity symbol arranged into stages representing the software development lifecycle\" width=\"1200\" height=\"675\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-vector\/devops-software-development-operations-infinity-symbol-1747572056\">LuckyStep\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>GitOps is a development methodology that advocates using versioned files in source control repositories to define and manage your infrastructure. Expressing your architecture as declarative files provides a way to inspect your system\u2019s current configuration, merge changes from multiple contributors, and rollback to an earlier state.<\/p>\n<p>So far this <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>roach sounds similar to Infrastructure as Code (IaC). GitOps is more than mere IaC though: a successful implementation will incorporate an <em>automated<\/em> mechanism to apply your config files to live infrastructure components. Merging changes should cause your infrastructure\u2019s state to transition towards that described by the revised repository content.<\/p>\n<p>This requires a bridge between your source control platform and your infrastructure provider, allowing the current state to be communicated between the two. There are different ways in which this bridge can be implemented, each placing a unique set of responsibilities on the platforms involved. In this article we\u2019ll look at the Agent-based (or Pull-based) deployment model, then compare it to a Push-based approach.<\/p>\n<h2 id=\"whats-an-agent\"><span class=\"ez-toc-section\" id=\"Whats_An_Agent\"><\/span>What\u2019s An Agent?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Agent-based GitOps refers to running a process inside your infrastructure that facilitates your deployments. The process is responsible for maintaining communication with the source control platform that hosts your IaC files.<\/p>\n<p>An Agent is an <em>active<\/em> part of your infrastructure. It\u2019ll periodically connect to your Git repository, check for changes, and pull new commits into your deployment environment. The agent will subsequently take action to apply the fetched changes to its surroundings, triggering the appropriate state transition.<\/p>\n<p>Agents can provide extra features such as built-in deployment monitoring, logging, and alerting. These keep you continuously informed of activity within your infrastructure. The agent handles integration with your existing tools to surface relevant information in the appropriate places.<\/p>\n<p>The agent model differs from the conventional view of Continuous Integration and Continuous Deployment (CI\/CD) by cutting out the concept of the trigger-bound pipeline. Instead there\u2019s an automated reconciliation loop that fetches changes as they become available. New commits and merges only <em>indirectly<\/em> prompt a change to your infrastructure. It could be some time before the agent acquires the new data.<\/p>\n<p>Several vendors offer agents that can be used to implement GitOps workflows. GitLab now advocates the approach as its preferred way to deploy to Kubernetes, via the <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/docs.gitlab.com\/ee\/user\/clusters\/agent\">GitLab Agent for Kubernetes<\/a>. The agent connects to a GitLab instance from within your cluster, then facilitates two-way communication to rollout changes and send information back to your repositories.<\/p>\n<p><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.weave.works\/oss\/flux\">Flux by Weaveworks<\/a> is another option which works with any Git repository and includes alerting capabilities. Flux is now an incubator project within the Cloud Native Computing Foundation (CNCF). It runs as a Kubernetes operator that picks up changes made to your connected Git repos.<\/p>\n<h2 id=\"agent-advantages\"><span class=\"ez-toc-section\" id=\"Agent_Advantages\"><\/span>Agent Advantages<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Agent-based GitOps has multiple advantages which make it appealing to a variety of stakeholders. First there\u2019s the clear distinction between responsibilities: your source control platform is unchanged and doesn\u2019t need to concern itself with connections to your infrastructure. The Agent needs to be supplied with repository credentials but is otherwise self-sufficient. Once it\u2019s running, it\u2019s narrowly focused on detecting and applying changes.<\/p>\n<p>This separation of concerns can help you pinpoint problems and reason about deployment failures. You can <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/general\/\" data-internallinksmanager029f6b8e52c=\"3\" title=\"General\" target=\"_blank\" rel=\"noopener\">general<\/a>ly discard the source control platform straightaway. If it\u2019s up and your main branch contains the correct changes, discrepancies in your infrastructure\u2019s actual state must be down to an agent synchronization issue.<\/p>\n<p>Agents also offer a higher degree of automation than Push-based GitOps. To successfully adopt a Push-based flow, you\u2019ll need to configure your repository with credentials for your infrastructure and craft CI pipelines that run the correct scripts to transmit your changes. Those scripts will need to be copied across all your projects, maintained over time, and carefully handled to protect your sensitive credentials.<\/p>\n<p>Agent-based systems come without these concerns. Once an agent\u2019s installed, you benefit from a robust deployment model that\u2019s less susceptible to change. There are far fewer variables concerning connection to a Git repository than successful access to a production environment like a Kubernetes cluster. Hence it makes sense to pull changes from the simpler system into the more complex one.<\/p>\n<p>Another benefit is the positive security impact of agents. They run <em>inside<\/em> your infrastructure so you can avoid opening it up to outside access. While you will need to expose your Git repository, this is far less risky than providing a door into your production environment. Exposure of a GitHub project token is only likely to leak source code and your IaC files \u2013 a serious occurrence but one that pales in comparison with the thought of losing a production Kubernetes account token. That could lead to data theft, subsequent extortion, and irrecoverable system compromise.<\/p>\n<h2 id=\"what-about-push-based-gitops\"><span class=\"ez-toc-section\" id=\"What_About_Push-Based_GitOps\"><\/span>What About Push-Based GitOps?<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The alternative strategy is the Push-based model where changes are fed to your infrastructure by your source control platform or an inter<a href=\"https:\/\/buradabiliyorum.com\/en\/category\/social-mediaa\/\" data-internallinksmanager029f6b8e52c=\"1\" title=\"Social Media\" target=\"_blank\" rel=\"noopener\">media<\/a>ry system. The communication is initiated by something running outside the deployment environment. Pushes force the infrastructure to receive a new state from the controlling server.<\/p>\n<p>Push-based GitOps is usually implemented within your CI pipelines. You\u2019re using this model if you have a pipeline that\u2019s configured with a Kubernetes cluster connection and use <code>kubectl apply<\/code> to create deployments. Another example is a pipeline which runs <code>rsync<\/code> to synchronize your repository\u2019s content to a remote host.<\/p>\n<p>The limitations of this approach lie in its inability to offer the advantages associated with agents which we covered above. You need to manually configure each repository with an appropriate infrastructure connection, open up your environments to external access, and take responsibility for maintaining your deployment scripts over time.<\/p>\n<p>Push-based GitOps still has some unique benefits though. One significant factor is its inherent familiarity: you can keep using the tools you already know and rely upon in development, such as <code>kubectl<\/code>, <code>helm<\/code>, and <code>docker<\/code>. This helps to minimize differences between local and live deployments.<\/p>\n<p>Error handling can be simpler too. Push-based approaches tend to feel more synchronous which can be helpful in identifying the sequence of events leading up to a failure. While agents give you a clear starting point (the agent itself), you\u2019re then left to filter through the events corresponding to that agent\u2019s activities. Those events may cover dozens of distinct projects and reconciliation cycles. Being able to start from a specific CI pipeline run can therefore be helpful in providing immediate feedback while debugging.<\/p>\n<p>Finally there\u2019s an argument that the Push-based model is actually more adaptable to future infrastructure changes. Adopting Pulls means you\u2019re coupling your system to the specific expectations of your selected agent. This can quickly complicate matters if you need to deploy to a new platform where that agent\u2019s not supported. A scripted Push-based approach is more flexible here. It lets you cater for multiple distinct environments by incorporating conditional logic that takes the correct actions for the target platform.<\/p>\n<h2 id=\"summary\"><span class=\"ez-toc-section\" id=\"Summary\"><\/span>Summary<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Agent-based GitOps refers to running an active component within your infrastructure that reaches out to your source repository to fetch and apply changes. This inverts the Push-based model where you run scripts within CI pipelines to create deployments and apply state changes.<\/p>\n<p>The Push workflow is common, easily understood, and holds some significant attractions. However agent-driven \u201cpulls\u201d are gaining more attention across the cloud ecosystem as vendors and developers come to recognize their benefits.<\/p>\n<p>Adopting a Pull-based approach can reduce maintenance over time, improve the security of your environments, and help you identify failures when changes aren\u2019t getting applied. Agents can also simplify set up of peripheral features like alerts and metrics aggregation, accelerating your DevOps adoption path without manually piecing together complex CI scripts.\n<\/p><\/div>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.cloudsavvyit.com\/15561\/what-is-agent-based-gitops-and-how-does-it-differ-from-ci-cd\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;What Is Agent-Based GitOps and How Does It Differ From CI\/CD? \u2013 CloudSavvy IT&#8221; LuckyStep\/Shutterstock.com GitOps is a development methodology that advocates using versioned files in source control repositories to define and manage your infrastructure. Expressing your architecture as declarative files provides a way to inspect your system\u2019s current configuration, merge changes from multiple contributors,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":418195,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.cloudsavvyit.com\/p\/uploads\/2022\/02\/83eb197f.jpg","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-418194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/418194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=418194"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/418194\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/418195"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=418194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=418194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=418194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}