How do you roll back a GitOps deployment and what are the caveats?
AdvancedConceptDeployment Strategies and GitOps
Answer
Rollback is git revert of the offending commit in the config repo; the controller then reconciles the cluster to the previous state, keeping the audit trail intact. With Argo CD the CLI command argocd app rollback only works if auto-sync is disabled (otherwise the controller immediately re-syncs to Git), so it is a temporary emergency tool, not the proper fix.
Caveats: database migrations and stateful data are not rolled back by Git, secrets rotated since the last release may have changed, and CRD changes may need ordering. Prefer reverting through Git and let the pipeline run its checks.
git revert --no-edit <bad-commit> && git push origin main
argocd app wait shop-api --health --timeout 300