A hands-on developer-focused introduction to GitOps and Argo CD. Learn how GitOps works, why it matters, and how to deploy your first Kubernetes application using Argo CD with examples, diagrams, and real-world use cases.
📑 Table of Contents
- What Is GitOps?
- Why GitOps Matters for Developers
- Core Principles of GitOps
- Argo CD Overview & Architecture
- Installing Argo CD
- Deploying Your First Application with Argo CD
- Real-World GitOps Use Cases
- Common Developer Questions
- Related Tools & Libraries
What Is GitOps?
GitOps is an operational model where Git becomes the single source of truth for describing infrastructure and application state. Instead of pushing changes directly to Kubernetes, developers push configuration changes to Git, and an automated system continuously reconciles the current cluster state with what’s declared in the repo.
Simply put:
If it’s in Git → It should exist in the cluster.
If it’s not in Git → It should not exist in the cluster.
GitOps combines:
- Git
- Kubernetes
- Declarative configuration
- Continuous reconciliation
Why GitOps Matters for Developers
GitOps solves common DevOps pain points:
🔹 1. Full Visibility
Every change is visible, reviewed, and documented in Git.
🔹 2. Faster, Safer Deployments
Rollback = revert a Git commit.
🔹 3. No More “What Changed in Production?”
Infrastructure drift disappears.
🔹 4. Developers Don’t Need kubectl Access
Security improves while productivity stays high.
🔹 5. Consistent Multi-Environment Deployments
Perfect for microservices, staging clusters, and multi-region setups.
Core Principles of GitOps
✔️ Declarative Definitions
All infrastructure and app manifests live as code.
✔️ Versioned & Immutable
Git provides built-in history, approvals, and audit trails.
✔️ Continuous Reconciliation
A controller checks for drift and fixes it automatically.
✔️ Self-Healing
If someone manually changes a Deployment, the GitOps controller resets it.
Argo CD Overview & Architecture
Argo CD is a declarative GitOps controller for Kubernetes.
It watches Git, detects configuration changes, and applies them to the cluster automatically or manually based on policy.
Argo CD High-Level Architecture
┌───────────────────────────┐
│ Git Repo │
│ (Manifests / Helm / Kustomize)
└───────────────┬───────────┘
│
▼
┌──────────────────────────┐
│ Argo CD │
│ API Server + UI + CLI │
└─────────┬────────────────┘
│
┌─────────────────┴──────────────────┐
│ │
┌──────────────┐ ┌─────────────────┐
│ Repo Server │ │ Application Ctrl│
│ - Fetches Git │ │ - Sync engine │
│ - Renders │ │ - Health checks │
└───────┬──────┘ └──────┬──────────┘
│ │
└────────────────────────────────────┘
Applies Manifests
│
▼
┌─────────────────────┐
│ Kubernetes Cluster │
│ (Actual State) │
└─────────────────────┘
Installing Argo CD
Step 1 : Create namespace
kubectl create namespace argocd
Step 2 : Install Argo CD
kubectl apply -n argocd -f \
https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
Step 3 : Check ArgoCD components installed
kubectl -n argocd get all
Step 4 : Retrieve admin password
kubectl get secret argocd-initial-admin-secret -n argocd \
-o jsonpath="{.data.password}" | base64 -d
Step 5 : Access the UI
kubectl port-forward svc/argocd-server -n argocd 8080:443
Open:
https://localhost:8080
Login as:
username: admin
password: <the password above>
Deploying Your First Application with Argo CD
Let’s deploy a real Kubernetes app using an Argo CD Application resource.
1. Create an Argo CD Application manifest
guestbook-app.yaml
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: guestbook
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/argoproj/argocd-example-apps
targetRevision: HEAD
path: guestbook
destination:
server: https://kubernetes.default.svc
namespace: default
syncPolicy:
automated:
selfHeal: true
prune: true
2. Apply it
kubectl apply -f guestbook-app.yaml
Argo CD will:
- Fetch code from Git
- Render YAML
- Compare with live cluster
- Deploy the manifests
- Continuously watch for drift
Real-World GitOps Use Cases
🚀 1. Multi-Environment Promotion
/environments/dev
/environments/test
/environments/prod
Promote via Git PRs instead of manual deploys.
🧩 2. Microservices at Scale
Each app = one Argo CD Application.
Perfect for teams with 10–200+ microservices.
🔄 3. Automatic Rollbacks with Git
Revert the commit → Argo CD syncs.
🔐 4. More Secure Deployments
Teams remove direct kubectl access for developers.
📦 5. Helm + Kustomize Deployments
Argo CD handles both seamlessly.
Developer Tips
- Use App of Apps pattern for large clusters.
- Use health checks to fail early.
- Enable selfHeal to auto-correct cluster drift.
- Use sync waves for ordering complex deployments.
- Store secrets using SOPS or Sealed Secrets.
Common Developer Questions
1. Does GitOps replace CI/CD?
No. CI builds artifacts. GitOps handles deployments.
2. Can I use Helm charts with Argo CD?
Yes -> native support.
3. How does Argo CD detect drift?
It continuously compares the live cluster state with what’s in Git.
4. Can Argo CD deploy to multiple clusters?
Yes, easily.
5. How do I manage secrets?
Use:
- SOPS
- Sealed Secrets
- External Secrets Operator
6. Do I need to give developers kubectl access?
Not anymore -> GitOps removes the need.
Related Tools & Libraries
GitOps Tools
- Argo CD
- Flux CD
Template Tools
- Helm
- Kustomize
- Jsonnet
Secrets Management
- Mozilla SOPS
- Bitnami Sealed Secrets
- HashiCorp Vault
CI Tools (Pair with GitOps)
- GitHub Actions
- GitLab CI
- Jenkins
- Argo Workflows
Conclusion
GitOps and Argo CD bring reliability, visibility, and automation to Kubernetes operations.
If your team uses Kubernetes, adopting GitOps is one of the fastest ways to improve release safety and developer productivity.
👉 If you found this tutorial useful and want to stay updated on GitOps, Argo CD, Kubernetes, DevOps, AI and cloud engineering topics feel free to connect with me on:
linkedin.com/in/vjcloudops
vjcloudops.medium.com
Hope this is insightful...
Thanks for reading...
If you find this useful do like and subscribe for more updates on this series !!!



Top comments (0)