🎯 Task #3 — Enable AutoSync + Health Checks + Self-Heal in ArgoCD
Latchu@DevOps

Latchu@DevOps @latchudevops

About: Infra. Automation. Impact

Location:
Chennai, India
Joined:
Apr 10, 2025

🎯 Task #3 — Enable AutoSync + Health Checks + Self-Heal in ArgoCD

Publish Date: Nov 27 '25
5 0

ArgoCD is powerful because it continuously watches Git and your cluster, and keeps them in sync.
This task enables:

✅ Auto-Sync

Automatically apply changes from Git to the cluster.

✅ Self-Heal

If someone manually edits or deletes a Kubernetes object, ArgoCD restores it from Git.

✅ Auto-Prune

Remove Kubernetes resources that were removed from Git.

✅ Rollbacks

If a sync fails, ArgoCD will automatically roll back to a good version.


⭐ Step 1 — Enable AutoSync in ArgoCD UI

Go to:

Applications → Select your app → App Details → Sync Policy

Turn ON:

  • Auto-Sync
  • Prune Resources
  • Self Heal

1

These correspond to:

Setting Meaning
Auto-Sync If Git changes, ArgoCD automatically applies the changes to the cluster.
Prune If a file (resource) is deleted from Git, ArgoCD deletes that resource from the cluster.
Self-Heal If someone manually changes something in the cluster (via kubectl), ArgoCD restores it back to match Git.

⭐ Step 2 — Verify AutoSync is Working

(1) Update something in Git

Edit your deployment.yaml image tag:

image: nginx:1.27
Enter fullscreen mode Exit fullscreen mode

Push it:

git add .
git commit -m "Update version"
git push
Enter fullscreen mode Exit fullscreen mode

Expected result:

  • ArgoCD UI shows "OutOfSync → Syncing → Healthy"
  • New image deployed automatically

2

If you check with pods,

3


⭐ Step 3 — Test Self-Heal (Drift Correction)

Modify something manually in the cluster:

kubectl edit deploy demo-app
Enter fullscreen mode Exit fullscreen mode

Change replicas from 2 to 5 and save.

➡️ ArgoCD will detect drift
➡️ ArgoCD will automatically revert replicas back to the Git value (e.g. 2)

This proves self-heal is working.

4


⭐ Step 4 — Test Auto-Rollback

Break the deployment:

Edit your deployment.yaml and use a fake image:

image: nginx:does-not-exist
Enter fullscreen mode Exit fullscreen mode

Push it.

Expected:

  • ArgoCD tries to sync
  • Sync fails
  • ArgoCD rollback mechanism applies the last healthy version automatically (using retry + failure detection)

Your app will remain healthy 👌


⭐ Step 5 — Test Auto-Prune

Delete the service from GitHub:

rm service.yaml
git add .
git commit -m "Remove service"
git push
Enter fullscreen mode Exit fullscreen mode

➡️ ArgoCD will detect the file removed
➡️ It will delete the Service in Kubernetes automatically

5


🎉 Final Result — What You Achieved

With Task #3 completed, your app now has:

| Feature                                     | Status    |
| ------------------------------------------- | --------- |
| Automatic Git → Cluster sync                | ✅ Enabled |
| Automatically revert manual kubectl changes | ✅ Enabled |
| Automatically delete removed resources      | ✅ Enabled |
| Automatic rollback to last good version     | ✅ Enabled |
| Continuous health monitoring                | ✅ Enabled |
Enter fullscreen mode Exit fullscreen mode

🌟 Thanks for reading! If this post added value, a like ❤️, follow, or share would encourage me to keep creating more content.


— Latchu | Senior DevOps & Cloud Engineer

☁️ AWS | GCP | ☸️ Kubernetes | 🔐 Security | ⚡ Automation
📌 Sharing hands-on guides, best practices & real-world cloud solutions

Comments 0 total

    Add comment