ArgoCD is a declarative, GitOps-based continuous delivery tool for Kubernetes. In the GitOps model, Git is the single source of truth for both application code and infrastructure configuration — when a developer pushes a change to a Git repository, ArgoCD automatically detects the change and applies it to the Kubernetes cluster, keeping the live cluster state in sync with the desired state defined in Git. ArgoCD continuously monitors both the Git repository and the live cluster, detecting and optionally auto-correcting any drift between them. This provides automatic audit logs of every change (every deployment maps to a Git commit), easy rollback (revert a Git commit to revert the deployment), and multi-environment support (separate branches or folders for dev/staging/production). This guide covers installing ArgoCD on a RHEL 9 Kubernetes cluster and configuring a GitOps deployment pipeline.

Prerequisites

  • Kubernetes cluster running on RHEL 9
  • kubectl with cluster admin access

Step 1 — Install ArgoCD

# Create the ArgoCD namespace and install
kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

# Wait for all pods to be ready
kubectl get pods -n argocd -w

# Install the ArgoCD CLI
curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64
chmod +x /usr/local/bin/argocd

Step 2 — Access the ArgoCD UI

# Get the initial admin password
kubectl get secret argocd-initial-admin-secret -n argocd 
    -o jsonpath="{.data.password}" | base64 -d && echo

# Forward the ArgoCD server port to your local machine
kubectl port-forward svc/argocd-server -n argocd 8080:443

# Or expose via NodePort:
kubectl patch svc argocd-server -n argocd -p '{"spec":{"type":"NodePort"}}'
kubectl get svc argocd-server -n argocd

# Access: https://server-ip:NODEPORT
# Login with: admin / (password from above)

Step 3 — Connect ArgoCD to a Git Repository

# Log in via CLI
argocd login localhost:8080 --username admin --password  --insecure

# Add a private Git repository (HTTPS)
argocd repo add https://github.com/myorg/k8s-manifests 
    --username myuser 
    --password ghp_personalAccessToken

# Verify repository connection
argocd repo list

Step 4 — Create a GitOps Application

# Create an ArgoCD Application that syncs from Git
argocd app create myapp 
    --repo https://github.com/myorg/k8s-manifests 
    --path manifests/production 
    --dest-server https://kubernetes.default.svc 
    --dest-namespace myapp 
    --sync-policy automated 
    --auto-prune 
    --self-heal

# Check application status
argocd app get myapp
argocd app sync myapp  # Manual sync trigger

Step 5 — View Sync Status and History

argocd app list
argocd app history myapp   # Deployment history mapped to Git commits
argocd app rollback myapp  # Roll back to the previous deployment

Conclusion

ArgoCD on RHEL 9 Kubernetes implements GitOps continuous delivery, making Git commits the atomic unit of deployment rather than manual kubectl apply commands. The --self-heal flag automatically reverts manual changes made directly to the cluster (via kubectl) that drift from the Git state — essential for preventing configuration drift in production environments. For teams new to GitOps, start without --sync-policy automated so that Git pushes do not immediately trigger production deployments; configure automatic sync only for non-production environments first.

Next steps: How to Configure Kubernetes RBAC on RHEL 9, How to Monitor Kubernetes with Prometheus on RHEL 9, and How to Install Jenkins on RHEL 9.