Weave Engineer/Jon Stevens/GitOps

Published Mon, 13 Jun 2022 16:22:22 -0600
546 Words

GitOps at Weave

At Weave, we use GitOps for A LOT of things. This is a series of articles about GitOps at Weave. But, first, what is GitOps?

What is GitOps?

The core idea of GitOps is having a Git repository that contains the declarative state of your desired infrastructure and an automated process to apply that state to a cloud native environment. Applying this idea to your deployments can be very powerful.

Why GitOps for Deployments?

Deploy faster and more often

All developers are used to the process where they check out a feature branch, write some code, and push it to Git. With GitOps, that is also the process for deployments. Deployments can happen automagically when you push your code to a repository. And the status of your CD pipeline can be included alongside your repository. In the case of GitHub, you can have status checks and badges on commits and PRs, Actions pipelines, and actual GitHub deployment statuses; all of which show up right next to your code. 😮

Better developer experience and efficiency

Developers can use tools they are most familiar with to deploy by pushing code, not containers. All of your developers should already be familiar with Git. By eliminating the need for your developers to learn an additional system to deploy their code, you save them time in their onboarding and deployment processes. It also gets rid of the need to context switch between writing code and deploying it.

Change log and deployment history

Having your deployments live alongside its code, allows you to easily track the history of your deployments as it relates to the actual code running within each deployment. This is super useful when troubleshooting a bug in your system.

Faster recovery times

When you encounter an error, you can easily roll back to the previous deployment by simply reverting a commit or PR. This is very powerful as it is also included in the change log of your code and deployments. Within your repository, you can see the commit that caused the issue, and the rollback or revert commit that fixed the issue.

Improved security

All companies need to optimize permissions and access for developers inside their version control system. GitOps means that you don’t have to worry about setting up all of those permissions in another system.

Reduced costs

By limiting the number of systems your developers need to learn, you save on developer time and resources by eliminating the need to run another deployment system.

Added consistency and standardization

If all of your infrastructure has to be defined in a single repository, it allows you to enforce consistency and standards to your deployments. We do this by enforcing that all deployments must start with a valid WAMLâ„¢ (our in-house manifest file that describes a service).

Tooling decoupled from process

When the only thing your developers have to worry about is pushing code, it gives you the freedom to choose the tools that work the best. It also allows you to migrate systems under the hood if necessary without interrupting the process of your developers.

GitOps Series