"Just run kubectl apply." Those words used to be our deployment strategy. Then one day, someone ran the wrong manifest in production. That was the day I discovered GitOps.
🌑 The Dark Ages (Before GitOps)
Our deployment process was... creative:
- Developer pushes code to GitHub
- CI builds Docker image, pushes to registry
- Developer updates manifest locally
- Developer runs
kubectl apply -ffrom their laptop - Everyone prays
- No audit trail - who deployed what?
- Drift - cluster state didn't match git
- Rollbacks meant "find the old manifest somewhere"
- Different kubectl configs on different laptops
🤔 Why ArgoCD?
I evaluated Flux, ArgoCD, and Jenkins X. ArgoCD won for us because of:
Beautiful UI
Visual representation of your deployments
Sync Policies
Auto-sync, self-heal, prune - all configurable
Multi-Cluster
One ArgoCD to rule all clusters
App of Apps
Bootstrap entire environments from git
🛠️ Setting Up ArgoCD
Installation is surprisingly simple:
# Create namespace
kubectl create namespace argocd
# Install ArgoCD
kubectl apply -n argocd -f \
https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Get initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret \
-o jsonpath="{.data.password}" | base64 -d
Then create your first Application:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/myorg/manifests
targetRevision: HEAD
path: apps/my-app
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
📐 GitOps Patterns We Adopted
Pattern 1: App of Apps
One "root" Application that points to a directory containing other Application manifests. Bootstrap an entire cluster from a single git path.
Pattern 2: Environment Branches
We use branch-per-environment: main → production, staging → staging. Promoting is just a PR merge.
Pattern 3: Sealed Secrets
Secrets in git? Use Sealed Secrets or External Secrets Operator. We can now have everything in version control.
📈 The Results
After 6 months of GitOps with ArgoCD:
Deployment frequency: +300% (daily → multiple per day)
Lead time for changes: -60% (hours → minutes)
Failed deployments: -80%
Mean time to recovery: -70% (git revert → instant rollback)
"kubectl apply" from laptops: 0 🎉
GitOps isn't just a deployment strategy - it's peace of mind. Your cluster state is always in sync with git, rollbacks are a git revert away, and you have a complete audit trail of every change.
Ready to start your GitOps journey? Let me know what questions you have!