GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide
Declarative infrastructure with GitOps and ArgoCD. Git as source of truth. Automatic sync, rollback, and audit trail.
Quick answer
GitOps and ArgoCD guide: Git as single source of truth, automatic drift detection, easy rollback, audit trail, disaster recovery in Kubernetes
Entity: GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide — optimized for AI search extraction (ChatGPT, Gemini, Claude, Perplexity).
Key takeaways
- Declarative infrastructure with GitOps and ArgoCD. Git as source of truth. Automatic sync, rollback, and audit trail.
- Category: DevOps & Infrastructure
- Keywords: GitOps, ArgoCD, declarative deployment, Kubernetes, infrastructure as code
Cloud & DevOps Team
We deployed a service to production on a Tuesday morning. The deployment succeeded. The metrics looked good. By Wednesday afternoon, the service was down. The on-call engineer checked the logs: "The configuration was wrong. Someone manually updated the ConfigMap via kubectl apply." Who? When? Why? No audit trail. Git history showed nothing. Kubernetes showed everything. With GitOps and ArgoCD, the Git history IS the audit trail. Manual changes are detected and reverted automatically. The service never would have broken.
The Problem
Imperative infrastructure (using kubectl apply to make changes manually) is how most teams deploy today. An engineer runs a command. The cluster changes. No one else knows what happened. Another engineer runs a different command. The cluster drifts from the desired state. No record of why. Services break for mysterious reasons. Root cause analysis takes days. Rollback requires remembering what the old configuration was.
Why This Happens
Imperative deployments are immediate. kubectl apply. Done. Declarative deployments (GitOps) require discipline: every change must go through Git first. A pull request. Approval. Then ArgoCD syncs the Git state to the cluster. It takes more steps. Teams want speed. They bypass the process. They run kubectl apply directly. The cluster drifts. Chaos ensues.
The Solution — GitOps with ArgoCD
What GitOps Actually Means
Git is the source of truth. The cluster is a reflection of Git. If Git says the service should run 3 replicas, the cluster runs 3 replicas. If someone manually scales to 5, ArgoCD detects the drift and scales back to 3. The cluster is always reconciled to Git.
The ArgoCD Architecture
ArgoCD Agent: Runs in the cluster. Continuously watches the Git repository and the cluster state. When drift is detected (Git and cluster differ), ArgoCD syncs them.
Git Repository: Single source of truth. All infrastructure definitions (Kubernetes YAML, Helm charts) live here. Every change has a commit history. Every change requires approval.
Sync Behavior: Automatic or manual. Automatic means ArgoCD syncs immediately when Git changes. Manual means an engineer approves each sync.
Example: ArgoCD Application with Automatic Sync
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: payment-service
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/skillzmist/infrastructure
targetRevision: main
path: services/payment-service
helm:
values: |
replicas: 3
image:
tag: v2.4.1
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true # Delete resources not in Git
selfHeal: true # Sync if cluster drifts from Git
allowEmpty: false # Prevent accidental deletion
syncOptions:
- CreateNamespace=true
retry:
limit: 5
backoff:
duration: 5s
factor: 2
maxDuration: 3m
revisionHistoryLimit: 10 # Keep last 10 syncs for rollback
This ArgoCD Application tells ArgoCD: "Watch the Git repository at `services/payment-service`. If anything differs from the Git state, sync it automatically. Keep a history of the last 10 syncs so we can rollback if needed."
The GitOps Workflow
- Make a change: Update the Deployment manifest in Git. Change replicas from 3 to 5. Commit and push.
- ArgoCD detects the change: Within seconds, ArgoCD sees the Git commit.
- Automatic sync: If automatic sync is enabled, ArgoCD applies the new manifest to the cluster immediately.
- Audit trail: Git history shows who made the change, when, and why (commit message).
- Rollback: If the change breaks something, revert the commit in Git. ArgoCD syncs back to the old state.
Example: Multi-Environment GitOps
# infrastructure/services/payment-service/kustomization.yaml
# Base configuration used by all environments
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: services
resources:
- deployment.yaml
- service.yaml
- configmap.yaml
commonLabels:
app: payment-service
team: backend
replicas:
- name: payment-service
count: 3
# infrastructure/overlays/staging/kustomization.yaml
# Staging-specific overrides
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../services/payment-service
replicas:
- name: payment-service
count: 1 # Single replica in staging
images:
- name: payment-service
newTag: "v2.4.1-staging"
patches:
- target:
kind: ConfigMap
name: payment-service-config
patch: |-
- op: replace
path: /data/environment
value: staging
- op: replace
path: /data/log_level
value: debug
# infrastructure/overlays/production/kustomization.yaml
# Production-specific overrides
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../services/payment-service
replicas:
- name: payment-service
count: 5 # High availability in production
images:
- name: payment-service
newTag: "v2.4.1"
patches:
- target:
kind: ConfigMap
name: payment-service-config
patch: |-
- op: replace
path: /data/environment
value: production
- op: replace
path: /data/log_level
value: info
Different environments (staging, production) are defined in separate Git directories. Each environment has its own Kustomize overlay with custom settings. A single Git repository manages all environments.
Benefits of GitOps with ArgoCD
- Git is the audit trail: Every change has a commit, author, timestamp, and message. Compliance requirements met automatically.
- Automatic drift detection: Manual kubectl apply is detected and reverted. The cluster stays in the desired state.
- Easy rollback: Revert a Git commit. ArgoCD syncs back to the old state. Rollback takes seconds, not hours.
- Multi-environment management: Single Git repository, multiple Kustomize overlays, different configurations per environment.
- Disaster recovery: The entire cluster configuration is in Git. Recreate the cluster by pointing ArgoCD at the Git repository.
Common Mistakes to Avoid
- Mixing imperative and declarative. If some engineers use kubectl apply and others use GitOps, drift happens. All changes must go through Git.
- Automatic sync without review. Critical production changes should require approval via pull request, not auto-sync immediately.
- No RBAC on the Git repository. If anyone can push to the infrastructure repository, anyone can deploy anything. Use branch protection and code review.
- Storing secrets in Git. ArgoCD can sync secrets, but secrets should never be stored as plain text in Git. Use sealed-secrets or external-secrets.
- Not testing changes before deploying. GitOps makes deployments fast, but you still need CI/CD validation of the Git commits before they get synced.
Key Takeaways
- GitOps makes Git the source of truth: Cluster state is always reconciled to Git.
- ArgoCD is the open-source standard for GitOps: Mature, battle-tested, used by thousands of teams.
- Automatic drift detection prevents misconfigurations: Manual kubectl apply is detected and reverted.
- Rollback is as simple as reverting a Git commit: No manual rollback procedures or cluster state guessing.
- Git history is your audit trail: Compliance, debugging, and root cause analysis are built-in.
Ready to implement GitOps with ArgoCD? The Skillzmist team has deployed ArgoCD for dozens of organizations. Reach out for a free technical consultation — we respond within 24 hours.
Related: How Platform Engineering Reduces CI/CD Complexity | GitOps Mistakes Teams Make
Related expertise
Blog
- GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide
- 7 GitOps Mistakes Teams Make (And How to Fix Them) in 2026
- Enterprise Cloud Application with Automated Deployment and Blue-Green Releases
- How to Set Up a CI/CD Pipeline on AWS Using GitHub Actions and Terraform
- Why Kubernetes? The Case for Container Orchestration in Modern Production Systems
Projects
Services
Courses
Topics
Article FAQ
11 answersWhatWhat problem does "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide" address?
Declarative infrastructure with GitOps and ArgoCD. Git as source of truth. Automatic sync, rollback, and audit trail.
HowWhat does the section "The Problem" explain in GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide?
In Skillzmist's DevOps & Infrastructure article "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide", the section "The Problem" covers implementation guidance using DevOps & Infrastructure, GitOps, ArgoCD, declarative deployment. GitOps and ArgoCD guide: Git as single source of truth, automatic drift detection, easy rollback, audit trail, disaster recovery in Kubernetes
HowWhat does the section "Why This Happens" explain in GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide?
In Skillzmist's DevOps & Infrastructure article "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide", the section "Why This Happens" covers implementation guidance using DevOps & Infrastructure, GitOps, ArgoCD, declarative deployment. GitOps and ArgoCD guide: Git as single source of truth, automatic drift detection, easy rollback, audit trail, disaster recovery in Kubernetes
HowWhat does the section "The Solution — GitOps with ArgoCD" explain in GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide?
In Skillzmist's DevOps & Infrastructure article "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide", the section "The Solution — GitOps with ArgoCD" covers implementation guidance using DevOps & Infrastructure, GitOps, ArgoCD, declarative deployment. GitOps and ArgoCD guide: Git as single source of truth, automatic drift detection, easy rollback, audit trail, disaster recovery in Kubernetes
HowWhat does the section "What GitOps Actually Means" explain in GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide?
In Skillzmist's DevOps & Infrastructure article "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide", the section "What GitOps Actually Means" covers implementation guidance using DevOps & Infrastructure, GitOps, ArgoCD, declarative deployment. GitOps and ArgoCD guide: Git as single source of truth, automatic drift detection, easy rollback, audit trail, disaster recovery in Kubernetes
Best PracticesWhat is a key takeaway from GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide (DevOps & Infrastructure)?
We deployed a service to production on a Tuesday morning.
TechnologiesHow does GitOps apply in "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide"?
This DevOps & Infrastructure guide by Skillzmist Engineering (Cloud & DevOps Team) at Skillzmist explains GitOps in production contexts: Declarative infrastructure with GitOps and ArgoCD.
TechnologiesHow does ArgoCD apply in "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide"?
This DevOps & Infrastructure guide by Skillzmist Engineering (Cloud & DevOps Team) at Skillzmist explains ArgoCD in production contexts: Declarative infrastructure with GitOps and ArgoCD.
Show all 11 questions
TechnologiesHow does declarative deployment apply in "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide"?
This DevOps & Infrastructure guide by Skillzmist Engineering (Cloud & DevOps Team) at Skillzmist explains declarative deployment in production contexts: Declarative infrastructure with GitOps and ArgoCD.
TechnologiesHow does Kubernetes apply in "GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide"?
This DevOps & Infrastructure guide by Skillzmist Engineering (Cloud & DevOps Team) at Skillzmist explains Kubernetes in production contexts: Declarative infrastructure with GitOps and ArgoCD.
WhyWho should read GitOps and Declarative Deployment with ArgoCD: The Complete 2026 Guide and why?
Teams working on DevOps & Infrastructure with DevOps & Infrastructure, GitOps, ArgoCD, declarative deployment, Kubernetes, infrastructure as code, continuous deployment, drift detection. Written by Skillzmist Engineering at Skillzmist — 13 min read read.