New recipes every week

Turn Complexity Into
Cloud Recipes

Learn Kubernetes, AI, DevOps and DevSecOps the CloudChef way. Practical guides, real-world examples, no fluff.

Free forever No paywall Practical guides Real-world examples
50+Guides
WeeklyNew posts
K8s + AITop topics
FreeAlways
ArgoCD DevOps Helm Tuesday, April 14, 2026 ⏱ Calculating...

🚨 Fix ArgoCD Upgrade Error: "spec.selector field is immutable" (Helm Upgrade Guide)

CC
CloudChef
thecloudchef.io
ArgoCD upgrade failed spec.selector immutable error

If you’re upgrading ArgoCD using Helm and hit this error:

UPGRADE FAILED: cannot patch "argocd-redis-ha-haproxy" with kind Deployment:
spec.selector: Invalid value: field is immutable

πŸ‘‰ This is a common issue during ArgoCD upgrades—especially when Helm chart versions change.


🧠 What This Error Means

Kubernetes is telling you:

  • You are trying to modify an immutable field
  • Specifically: spec.selector in a Deployment

πŸ‘‰ Immutable fields cannot be changed after resource creation.


πŸ” Why This Happens During ArgoCD Upgrade

  • You upgraded ArgoCD via Helm
  • The chart version changed labels/selectors
  • Kubernetes rejects the patch

πŸ‘‰ Example resource:

argocd-redis-ha-haproxy

The selector changed between versions—triggering the error.


πŸ“¦ Step 1: Check Current ArgoCD Chart Version

helm list -n argocd

πŸ“Š Step 2: Check Available Chart Versions

helm search repo argo/argo-cd --versions

πŸ‘‰ Compare current vs target version carefully.


⚠️ Step 3: Check for Breaking Changes

  • Label changes
  • Selector updates
  • Component changes (Redis HA, HAProxy)

πŸ‘‰ This is usually where the issue originates.


🧬 Why Upgrade Fails (Flow)

flowchart TD HelmUpgrade --> NewChart NewChart --> SelectorChanged SelectorChanged --> KubernetesReject KubernetesReject --> Error

🍳 CloudChef Recipe: Fix ArgoCD Upgrade Error

πŸ’‘ Tip: Copy commands directly using the copy button

πŸ”₯ Step 1: Delete the Problematic Deployment

kubectl delete deployment argocd-redis-ha-haproxy -n argocd
---

⚡ Step 2: Re-run Helm Upgrade

helm upgrade argocd argo/argo-cd -n argocd
---

πŸ›‘️ Step 3: Alternative (Force Upgrade)

helm upgrade argocd argo/argo-cd -n argocd --force
---

πŸš€ Step 4: Validate Deployment

kubectl get pods -n argocd
---

⚠️ Important Considerations

  • Deleting deployments may cause downtime
  • Always validate in staging first
  • Backup configs before upgrade

⚡ Best Practices for ArgoCD Upgrades

  • Check chart versions before upgrading
  • Read release notes carefully
  • Avoid skipping versions
  • Use staging for testing

🚫 Common Mistakes

  • ❌ Upgrading blindly
  • ❌ Ignoring immutable errors
  • ❌ Modifying selectors manually

πŸ”— Related CloudChef Guides


πŸ”₯ CloudChef Pro Tip

When you see:

field is immutable

πŸ‘‰ Think:

  • Chart version changed
  • Resource must be recreated
  • Not patched

πŸš€ Final Thoughts

This error isn’t a bug—it’s Kubernetes enforcing safe deployments.

πŸ”₯ CloudChef Tip: Treat upgrades as migrations, not simple updates.


πŸ”₯ Trending CloudChef Recipes

⭐ Popular CloudChef Recipes

No comments:

Post a Comment

πŸ’‘ Found this useful?

Share it with your Team or DevOps Friends πŸ‘‡