What is GitOps?
GitOps is a declarative method of managing infrastructure that is driven by committing code into a version control system. GitOps is an indirect, and usually imperative, approach to systems administration that gives a detailed history of past operations. GitOps is the practice of adding code to a Git repository to trigger an operational event (such as rebooting a server, creating a user account, or provisioning a new virtual server). Upon a successive file being uploaded to a specific location in Git, which may or may not require peer review to become complete and take effect, an action or set of actions will be taken. Each older version of the file will be saved in Git for future retrospection(s).
The term is a portmanteau of the software named Git and "Ops" which is short for [system] operations. Git itself was developed by Linus Torvalds and is the most popular distributed code versioning solution as of 2018. Some businesses may use GitOps with a different code versioning solution from Git itself. The term appears to have originated from Weaveworks.
GitOps was born of widespread automation and a need to audit systems administration (e.g., for security investigations or postmortems). As the popularity of the CI/CD pipeline has grown, triggering actions by uploading code has become a standard practice. GitOps is an extension of infrastructure-as-a-code -- using text to specify virtual servers' CPU, RAM, and hard disk capacities. Moreover GitOps is an outgrowth of event execution prompted by new files being uploaded into a code repository, often after one or two approvals of successful peer review. For root cause analysis, having detailed records in a centralized location can be of great value. Code versioning systems will continually track changes to configuration files as they are merged with the exact corresponding time and date. Pull-request detection can be set up to trigger actions and be the impetus of GitOps.
At the 18 minute and 46 second mark of this video presentation by Gene Kim, the DevOps guru states that the "top predictor of IT performance" was whether or not the Operations team was using a code version control system. In his book The DevOps Handbook says that in 2014 Puppet Labs found the same thing (on page 117). One factor in the "12 Factor App" methodology is having a single source code repository (https://12factor.net/). This methodology's adoption has increased lately, and this is right in line with ushering in adoption of GitOps with one exception: the twelve-factor app recommends environment variables never be stored in code repositories. It will be interesting to see how the industry reconciles GitOps and the twelve-factor app for environment variables.
If you need a GitOps consultant, please email sales [at] americandevops [dot] com.