← Back to blog
·2 min read·Kubernetes

GitOps with ArgoCD in Production

A practical guide to implementing GitOps workflows with ArgoCD for multi-environment Kubernetes deployments.

GitOps has become the de facto standard for deploying applications to Kubernetes. In this guide, I'll walk through how we implemented ArgoCD for production workloads across multiple environments.

What is GitOps?

GitOps is a operational framework that uses Git as the single source of truth for infrastructure and application definitions. Changes are made via pull requests, and an automated agent (ArgoCD) reconciles the desired state with the actual cluster state.

Key Principle

If it's not in Git, it doesn't exist in production.

Setting Up ArgoCD

Install ArgoCD in your management cluster:

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

Configure the ArgoCD CLI:

argocd login argocd.example.com --grpc-web argocd cluster add production-cluster --name production

Application Structure

We organize our GitOps repository with the following structure:

apps/ ├── base/ │ ├── deployment.yaml │ ├── service.yaml │ └── kustomization.yaml ├── overlays/ │ ├── staging/ │ └── production/

Multi-Environment Strategy

Each environment uses Kustomize overlays to manage differences:

apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: my-app-production namespace: argocd spec: project: production source: repoURL: https://github.com/org/gitops-repo targetRevision: main path: apps/overlays/production destination: server: https://production-cluster namespace: my-app syncPolicy: automated: prune: true selfHeal: true

Production Sync Policy

Enable automated sync only after thorough testing in staging. Start with manual sync for production environments.

Best Practices

  1. Use App of Apps pattern for managing multiple applications
  2. Implement sync waves for ordered deployments
  3. Set resource hooks for database migrations
  4. Configure RBAC with project-level isolation
  5. Enable notifications for sync status updates

Monitoring Sync Health

ArgoCD exposes Prometheus metrics out of the box. Key metrics to alert on:

  • argocd_app_sync_total — sync operation count
  • argocd_app_health_status — application health
  • argocd_app_reconcile_count — reconciliation frequency

Conclusion

GitOps with ArgoCD transformed our deployment workflow from manual kubectl applies to fully automated, auditable, and reversible deployments. The key is starting simple with one application and gradually expanding the pattern across your organization.

Related Articles