GitOps

About

GitOps is code-based infrastructure and operational procedures that rely on Git as a source control system, that leverages Git as the single source of truth.

You use Git pull requests to verify and automatically deploy system infrastructure modifications.

An evolution of Infrastructure as Code (IaC).

Drawing

Benefits

GitOps shares many of the same benefits as an agle feature branch workflow.

The first major benefit is ease of adoption due to the usage of common tools.

It brings transparency and clarity to an organization's infrastruscture needs around a central repo. It also allows to quickly experiment with new infrastructure configurations. If a new change don't behave as expected, a team can use Git history to revert changes to a known good state.

How it works

To achieve a full GitOps install, a pipeline is required.

  1. ArgoCD, Jenkins, Bitbucket Pipelines or CircleCi. (To automate and bridge the gap between PRs and the Orchestration system)

  2. Once this pipeline hooks are established and triggered from PRs, commands are executed to the orchestration piece.

Example

CI

The CI step will run tests and make sure it should be runnable and will also build the main branch and make a Docker image, by executing the Dockerfile inside the project.

CD

Kubernetes Manifest

We can create the Kubernetes manifest files with kind.

Create this files inside k8s in the infra projects folder.

To get the correct image version, you may use Helm that will handle the package name at runtime??.

Or use Kustomize which will update the deployment.yaml file everytime a change happens.

Every time you want to update the running version, you change the version-sha to the one of the last commit, in kustomize.yaml, and kustomize will behind the scenes update kubernetes.

Will be the agent to keep checking for changes.

It is installed inside Kubernetes.

Last updated