OpenShift GitOps

Before OpenShift GitOps we need to know what is GitOps?

Prem Kr
4 min readJan 17


GitOps is a declarative way to implement continuous deployment for cloud native applications. You can use GitOps to create repeatable processes for managing OpenShift Container Platform clusters and applications across multi-cluster Kubernetes environments. The GitOps workflow pushes an application through development, testing, staging, and production. GitOps either deploys a new application or updates an existing one, so you only need to update the repository; GitOps automates everything else.

In GitOps, the Git repository is the only source of truth for system and application configuration. This Git repository contains a declarative description of the infrastructure you need in your specified environment and contains an automated process to make your environment match the described state. Also, it contains the entire state of the system so that the trail of changes to the system state are visible and auditable. By using GitOps, you resolve the issues of infrastructure and application configuration sprawl.

GitOps uses Git repositories as a single source of truth to deliver infrastructure as code. Submitted code checks the CI process, while the CD process checks and applies requirements for things like security, infrastructure as code, or any other boundaries set for the application framework. All changes to code are tracked, making updates easy while also providing version control should a rollback be needed.

GitOps delivers:

· A standard workflow for application development

· Increased security for setting application requirements upfront

· Improved reliability with visibility and version control through Git

· Consistency across any cluster, any cloud, and any on-premise environment

Many other tools can be used together to build a GitOps framework. For example, git repositories, Kubernetes, continuous integration/continuous delivery (CI/CD) tools, and configuration management tools.

Now as we have clarity on GitOps we can discuss what OpenShift GitOps is?

OpenShift GitOps is an OpenShift add-on which provides Argo CD and other tooling to enable teams to implement GitOps workflows for cluster configuration and application delivery. OpenShift GitOps is available as an operator in the OperatorHub and can be installed with a simple one-click experience. Once installed, users can deploy Argo CD instances using Kubernetes custom resources.

Using Argo CD, teams can sync the state of OpenShift and Kubernetes cluster configurations and application deployments with Git repositories either manually or automatically with any change made in the Git repository. Furthermore, Argo CD increases visibility into the state of clusters and applications by identifying drifts and correcting them if the cluster or workloads deviate from the desired states. Taking advantage of OpenShift GitOps with Argo CD enables teams to have full visibility and traceability into changes rolled out to clusters, whether they originate from cluster configurations or application deployments. Every change is represented with a commit in the Git history of the repository.

Red Hat OpenShift GitOps ensures consistency in applications when you deploy them to different clusters in different environments, such as: development, staging, and production. Red Hat OpenShift GitOps organizes the deployment process around the configuration repositories and makes them the central element. It always has at least two repositories:

1. Application repository with the source code

2. Environment configuration repository that defines the desired state of the application

These repositories contain a declarative description of the infrastructure you need in your specified environment. They also contain an automated process to make your environment match the described state.

Red Hat OpenShift GitOps uses Argo CD to maintain cluster resources. Argo CD is an open-source declarative tool for the continuous integration and continuous deployment (CI/CD) of applications. Red Hat OpenShift GitOps implements Argo CD as a controller so that it continuously monitors application definitions and configurations defined in a Git repository. Then, Argo CD compares the specified state of these configurations with their live state on the cluster.

Argo CD reports any configurations that deviate from their specified state. These reports allow administrators to automatically or manually resync configurations to the defined state.

Logical architecture of OpenShift GitOps.

Key features

Red Hat OpenShift GitOps helps you automate the following tasks:

  • Ensure that the clusters have similar states for configuration, monitoring, and storage
  • Recover or recreate clusters from a known state
  • Apply or revert configuration changes to multiple OpenShift Container Platform clusters
  • Associate templated configuration with different environments
  • Promote applications across clusters, from staging to production

Hope you have liked the post, stay tuned, in my next blog will work on installing and configuring OpenShift GitOps.