top of page

Deliver: More efficient deployment in the cloud-native world with GitOps

Updated: Apr 29

In the fast-paced world of software development, agile and robust methods that enable fast, repeatable and reliable deployment processes are in demand. GitOps, a term first coined by Weaveworks (2017), has established itself as one such method. This technique uses Git as a “single source of truth” for the declaration and management of infrastructure and applications. In this blog post, I explain exactly what GitOps means and how it is best used in conjunction with Continuous Integration/Continuous Deployment (CI/CD) pipelines and modern tools such as GitLab CI/CD and ArgoCD.


What is GitOps?


GitOps is a method that relies on Git as a version control and source code management tool to simplify the automation and management of infrastructures and applications. By using Git as a central control tool, changes and updates are initiated by merge/pull requests and automatically implemented after approval. This not only promotes the transparency of all changes, but also security and compliance, as every step remains traceable and verifiable. The Git repository always contains the version that has been deployed.


How does GitOps work?





This diagram illustrates the process from code development to deployment in the production cluster. Here is a step-by-step explanation of the individual components and their interactions:


  1. Source Code Repo (Code): This is where the source code of the app itself is located and where the developers work on code changes. Developers should only write code here, everything CI/CD must be completely automated.

  2. Deployment Repo (Infrastructure): Developers or better the platform team push deployment manifests (e.g. Helm charts, Kustomize configurations, ArgoCD apps) into a Git repository. This repo is the central source of truth for the infrastructure definitions.

  3. CI Pipeline: As soon as changes are available in the Git repository, a Continuous Integration (CI) pipeline is triggered. CI tools such as GitLab CI/CD or GitHub Actions perform tasks such as building the code, executing tests and quality checks.

  4. Images Registry (Docker Registry/Hub): After successful integration, the resulting application container images are sent to an image registry (e.g. Harbor or Docker Hub), where they are available for future deployments.

  5. Pull Changes: ArgoCD constantly monitors the Infra repository for changes. If it detects a change, it “pulls” it to update the configuration in the Kubernetes cluster. Since ArgoCD pulls changes from the infra repo, the CI/CD system does not need any access to Kubernetes.

  6. CD Pipeline (ArgoCD): The Continuous Deployment (CD) pipeline with ArgoCD takes over the synchronization between the desired state defined in the Git repo and the actual state in the Kubernetes cluster.

  7. Permanent Sync: ArgoCD ensures that the state of the Kubernetes cluster always corresponds to the desired state defined in the deployment repo. In the event of deviations, ArgoCD automatically makes adjustments to ensure conformity.


Through this workflow, GitOps enables a reproducible, declarative and version-controlled approach to application deployment. Developers can control infrastructure and applications by making changes in the Git repository, providing a clear history of changes and simplified traceability.


Advantages of GitOps


  • Automation: Fully automatic deployments and rollbacks in the event of errors. If manual changes are made, ArgoCD can undo them immediately (if this is configured).

  • Security and Compliance: Every change is documented and traceable. Changes can be checked by several people using merge requests. Manual changes are no longer made in a productive system.

  • Speed and Reliability: Reduced error rate and faster response times to problems.

  • Traceability: Every change is traceable in the Git repo, there are no more manual changes that nobody knows about or that cannot be assigned to a person.

  • Single Source of Truth: The current status can be viewed at any time in the Git repo. Changes can be tracked at any time with a diff.


Summary


GitOps is revolutionizing the way companies manage their development and operations processes by providing a robust, secure and transparent method for managing infrastructures and applications. By using tools such as ArgoCD in a GitOps-based workflow, organizations can accelerate their deployment cycles and operate their systems more efficiently. This leads to a significant improvement in development quality and operational stability, which ultimately supports business success.

9 views

Comments


bottom of page