The way organizations manage applications and infrastructure has dramatically shifted in recent years. Traditional manual deployments have given way to automation-driven approaches, ensuring consistency, reproducibility, and faster delivery cycles. Among these approaches, GitOps has emerged as a modern operational framework that applies DevOps best practices to infrastructure automation.
GitOps leverages Git repositories as the single source of truth for declarative infrastructure and applications. When combined with tools like Helm, OpenShift, and ArgoCD, GitOps provides a powerful workflow for automating application lifecycle management across environments.
In this article, we will dive deep into how to migrate to a GitOps workflow using Helm, OpenShift, and ArgoCD, complete with examples, practices, and a structured step-by-step approach.
Understanding GitOps
Before implementing GitOps, it’s important to understand what it entails.
GitOps revolves around four core principles:
-
Declarative Descriptions – All system components (infrastructure, apps, policies) are declared as code in Git.
-
Single Source of Truth – Git is the canonical source of what should be running in your environments.
-
Automated Delivery – A Git push triggers automated reconciliation processes to align cluster state with Git state.
-
Continuous Reconciliation – An operator continuously monitors live environments and ensures they match the Git-defined state.
By adopting GitOps, teams gain consistency, observability, and traceability across deployments.
Why Helm, OpenShift, and ArgoCD?
When building a GitOps workflow, the combination of Helm, OpenShift, and ArgoCD stands out for several reasons:
-
Helm simplifies Kubernetes deployments by packaging apps into reusable charts, making it easier to manage complex applications.
-
OpenShift provides an enterprise-ready Kubernetes platform with additional features like built-in CI/CD, security, and developer tools.
-
ArgoCD acts as the GitOps operator, ensuring that the desired state in Git matches the cluster’s actual state by automating synchronization and rollback.
This trio ensures that applications are not only reproducible but also secure and manageable at scale.
Preparing Your Environment
To migrate to GitOps, ensure your environment has the following components set up:
-
OpenShift Cluster – Either on-premises or on a cloud provider.
-
Helm CLI – For managing Helm charts locally before pushing to Git.
-
ArgoCD Installed on OpenShift – To monitor repositories and sync states.
-
Git Repository – The central hub where your deployment manifests or Helm charts will live.
Example installation for Helm (locally):
For OpenShift, you’ll typically already have the cluster running, and you can log in using the oc
CLI:
Installing ArgoCD in OpenShift (using the OpenShift GitOps operator):
Once installed, you can access the ArgoCD UI from the OpenShift console.
Structuring Your Git Repository
A GitOps repository must be well-structured to enable automation. There are two popular approaches:
-
App of Apps Pattern: A parent application defines child applications in ArgoCD, each pointing to its own repo or folder.
-
Environment-Based Structure: Different branches or directories for environments like
dev
,staging
, andprod
.
Example repository structure:
This structure allows you to reuse the same Helm chart across multiple environments, with environment-specific overrides.
Creating a Helm Chart
Helm charts package Kubernetes manifests into reusable templates. Let’s create a sample chart for a basic application.
This generates a folder structure with default templates. For example, your Deployment template (templates/deployment.yaml
) may look like this:
And in values.yaml
, you might define:
To deploy locally (before GitOps):
Configuring ArgoCD To Use Helm
Now that the chart exists in your Git repo, you need to configure ArgoCD to use it.
First, create an ArgoCD application manifest (let’s call it my-app-argo.yaml
):
Apply the manifest:
ArgoCD will now continuously monitor the repo and deploy/update the application whenever changes are pushed to Git.
Managing Multiple Environments
One of the strongest advantages of GitOps with Helm and ArgoCD is managing multiple environments seamlessly.
Let’s say you have three environments: dev, staging, and prod. Each environment uses the same Helm chart but different values files.
Example: values-prod.yaml
You can create separate ArgoCD applications for each environment, all pointing to the same chart but different values files.
For example, my-app-prod-argo.yaml
would look similar but reference values-prod.yaml
.
Testing the GitOps Workflow
At this stage, the workflow looks like this:
-
Developer pushes code changes → CI pipeline builds the image and updates the Helm chart values (image tag).
-
Git repository is updated → ArgoCD detects the change automatically.
-
ArgoCD syncs cluster state → OpenShift deploys the updated Helm release.
-
Cluster reconciles continuously → Any manual drift (e.g., if someone changes replicas directly) is corrected.
You can test by editing values-dev.yaml
and changing replicaCount
:
Commit and push:
Within seconds, ArgoCD will notice the change and update the deployment in OpenShift.
Handling Secrets Securely
A major concern in GitOps is managing sensitive data. Storing secrets in plain Git is risky.
There are multiple ways to manage this:
-
Sealed Secrets (Bitnami): Encrypt secrets before committing them.
-
External Secret Operators: Pull secrets dynamically from a vault (e.g., HashiCorp Vault, AWS Secrets Manager).
-
OpenShift Vault Integration: Use Kubernetes-native secret management with restrictions.
Example using Sealed Secrets:
Commit sealed-secret.yaml
safely to Git, and only the cluster can decrypt it.
Scaling and Advanced Features
Once the basic workflow is established, you can enhance it with:
-
ApplicationSets in ArgoCD – Automatically generate multiple applications from templates.
-
Progressive Delivery – Integrate with tools like Argo Rollouts for canary and blue-green deployments.
-
Monitoring & Alerts – Use OpenShift Monitoring stack or integrate ArgoCD with Prometheus/Grafana for visibility.
Example ApplicationSet for multiple environments:
This eliminates the need to define multiple Application
manifests manually.
Common Pitfalls To Avoid
While migrating, keep in mind some pitfalls:
-
Mixing Manual and GitOps Changes – Always let Git be the single source of truth. Manual
oc
orkubectl
edits cause drift. -
Poor Repository Structure – Disorganized repos make scaling GitOps painful.
-
Secrets Mismanagement – Never store plain secrets in Git.
-
Ignoring Rollback Strategy – Ensure Helm and ArgoCD can revert to previous versions in case of failure.
-
Underestimating Resource Quotas – Different environments may have varying capacity needs; always test with realistic values.
Conclusion
Migrating to a GitOps workflow with Helm, OpenShift, and ArgoCD transforms how teams deliver and manage applications. By making Git the source of truth, organizations gain consistency, reliability, and automation across environments. Helm charts enable reusability and flexibility, while ArgoCD ensures continuous reconciliation between the desired and actual state.
The migration involves several steps: setting up the environment, structuring the Git repository, creating Helm charts, configuring ArgoCD applications, and managing multiple environments. Adding secret management and scaling strategies further strengthens the workflow.
The key benefits include:
-
Auditability: Every change is traceable in Git.
-
Scalability: Easily manage multiple apps and environments.
-
Resilience: Continuous reconciliation ensures system health.
-
Speed: Developers focus on code, while GitOps automates deployments.
Adopting GitOps is not just a tooling change; it’s a cultural shift that enforces discipline and accelerates software delivery. With Helm providing flexibility, OpenShift ensuring enterprise-grade Kubernetes, and ArgoCD automating reconciliation, your team will be well-equipped to deliver reliable and scalable applications in a modern cloud-native world.