{"id":4556,"date":"2017-08-08T17:51:12","date_gmt":"2017-08-08T17:51:12","guid":{"rendered":"https:\/\/redmonk.com\/jgovernor\/?p=4556"},"modified":"2018-07-03T09:20:17","modified_gmt":"2018-07-03T09:20:17","slug":"oh-hai-gitops-what-is-gitops","status":"publish","type":"post","link":"https:\/\/redmonk.com\/jgovernor\/oh-hai-gitops-what-is-gitops\/","title":{"rendered":"Oh Hai GitOps. What is GitOps?"},"content":{"rendered":"<p><a href=\"http:\/\/jgovernor-media.redmonk.com\/jgovernor\/files\/2017\/08\/gitops.jpg\"><img loading=\"lazy\" decoding=\"async\" style=\"display: inline; background-image: none;\" title=\"gitops\" src=\"http:\/\/jgovernor-media.redmonk.com\/jgovernor\/files\/2017\/08\/gitops_thumb.jpg\" alt=\"gitops\" width=\"621\" height=\"467\" border=\"0\" \/><\/a><\/p>\n<p>My friends at Weaveworks have started describing how they manage infrastructure as \u201c<a href=\"https:\/\/www.weave.works\/blog\/gitops-operations-by-pull-request\">GitOps<\/a>\u201d &#8211; which is to say, operations by pull request (PR). I have come across other organisations doing similar things. GitHub is now so central to how modern teams work, that it\u2019s natural it would become a management hub for systems automation, serving as a both a system of record and a system of engagement for configuration as code platforms such as Ansible, Chef, and Puppet and or infrastructure as code like CloudFormation and Terraform.<\/p>\n<p>In case you\u2019re not already using Github and are not used to the vernacular, a pull request is used to informs others about changes you&#8217;ve pushed to a repository, generally once you\u2019ve completed a feature of piece of code, as part of the approval process. But Developer teams have begun to use pull requests to automate infrastructure workflows. Using Git creates an audit trail of human readable systems changes &#8211; which Weaveworks describes as a \u201csource of the truth.\u201d A diff means not all changes have been propagated yet.<\/p>\n<p>So what are the characteristics of GitOps as practiced by Weaveworks?<\/p>\n<ul>\n<li>Our provisioning of AWS resources and deployment of k8s is declarative<\/li>\n<li>Our entire system state is under version control and described in a single Git repository<\/li>\n<li>Operational changes are made by pull request (plus build &amp; release pipelines)<\/li>\n<li>Diff tools detect any divergence and notify us via Slack alerts; and sync tools enable convergence<\/li>\n<li>Rollback and audit logs are also provided via Git<\/li>\n<\/ul>\n<p>In tech we\u2019re seeing a generational shift from mutable, imperative infrastructure to immutable, declarative infrastructures. That\u2019s where GitOps makes sense. In that context Weaveworks uses Terraform to provision and maintain VMs, networking, security groups, ELBs, RDS instances, DynamoDB tables, S3 buckets, IAM roles, and\u00a0 Ansible for managing Kubernetes components including the Docker engine, the Kubelet, the Kube-proxy, the API Server, the Scheduler, the Controller Manager, Etcd. Weaveworks wrote a tool to parse the difference between desired and actual state in Kubernetes called <a href=\"https:\/\/github.com\/weaveworks\/kubediff\">kubediff<\/a>.<\/p>\n<p>In this post I have, perhaps unfairly, been using GitHub as shorthand for Git-based source code management. There are of course other platforms &#8211; notably Atlassian Bitbucket and GitLab worth a mention here. It should not surprise us that Atlassian\u2019s Kubernetes team has also established a GitOps approach, although it came up with a different name &#8211; <a href=\"https:\/\/developer.atlassian.com\/blog\/2017\/07\/kubernetes-workflow\/\">BDDA<\/a> (pronounced &#8216;Buddha&#8217;) for &#8220;Build-Diff,Deploy-Apply&#8221;.<\/p>\n<p>Atlassian\u2019s design goals were<\/p>\n<ul>\n<li>Ensure that we can reprovision things as easily as possible (preferably reasonably quickly as well)<\/li>\n<li>Uses declarative configuration rather than imperative<\/li>\n<li>Allow us to use automated testing, with all relevant information stored in a central repo<\/li>\n<\/ul>\n<p>In terms of declarative configuration, as Nick Young says:<\/p>\n<p style=\"padding-left: 30px;\">\u201cthe reconciliation loop at the heart of Kubernetes is built around the idea of declaring the desired state of things and then waiting for the system to bring the world into line with the desired state.\u201d<\/p>\n<p>Version control with Git gives us an audit trail for Observe, Orient, Decide and Act loops in software development for declarative infrastructure. Which brings us to other aspects of DevOps approaches in developer-led teams. GitOps only makes sense in conjunction with other disciplines, notably around chat-based team collaboration (ChatOps) and deep Observability.<\/p>\n<p>Charity Majors of <a href=\"https:\/\/honeycomb.io\/\">Honeycomb<\/a> has been doing excellent work recently distinguishing between \u201cmonitoring\u201d and \u201cobservability\u201d. Systems need to be engineered to to be understandable, explorable, and self-explanatory in the kind of world of automated, declarative world of continuous changes Docker and Kubernetes define.<\/p>\n<p>ChatOps, using chat interfaces to interact with team mates and systems, is related. Observability is a team sport. Developers basically live in 3 places &#8211; their chosen text editor or IDE, Slack and Github. You need to be able to identify problems and issues, work together to identify the best fix, and then put it into production. Now we have a potential name for infrastructure diff part of the equation. I am not sure \u201cGitOps\u201d is perfect, but it\u2019s catchy. Please let me know if you\u2019re doing anything similar, and what you call it.<\/p>\n<p>&nbsp;<\/p>\n<p>Full disclosure: Docker is a client. Weaveworks is in a coworking space I run. All opinions are my own.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>My friends at Weaveworks have started describing how they manage infrastructure as \u201cGitOps\u201d &#8211; which is to say, operations by pull request (PR). I have come across other organisations doing similar things. GitHub is now so central to how modern teams work, that it\u2019s natural it would become a management hub for systems automation, serving<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","footnotes":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[496],"tags":[71,499,133,454,498,459,500,497],"class_list":["post-4556","post","type-post","status-publish","format-standard","hentry","category-ops","tag-atlassian","tag-bitbucket","tag-devops","tag-github","tag-gitops","tag-monitoring","tag-pull-request","tag-terraform"],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9wfjh-1bu","_links":{"self":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/4556","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/comments?post=4556"}],"version-history":[{"count":0,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/posts\/4556\/revisions"}],"wp:attachment":[{"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/media?parent=4556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/categories?post=4556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/redmonk.com\/jgovernor\/wp-json\/wp\/v2\/tags?post=4556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}