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
- Conclusion + Call to Action
- SEO Keywords
- Suggested Dev.to Tags
- Canonical Link Notice
- Cover Image
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)