How to Revert ArgoCD Admin Password Back to Initial Cluster Secret?

How to reset the ArgoCD admin password back to its initial value after it has been changed?

Issue Description:

The ArgoCD admin password is stored as a secret within the cluster. This password is used by various service accounts and is essential for the operation of related services, including Redis. Changing the password can interfere with the operation of services that rely on it, ultimately causing a deterioration in cluster health.

Resolution: To revert the ArgoCD admin password to the initial value stored within the cluster secret, follow these steps.

  1. Nullify the Current Password: Execute the following command to reset the current admin password settings in Argo CD:
kubectl -n argocd patch secret argocd-secret -p '{"data": {"admin.password": null, "admin.passwordMtime": null}}'
 
  1. Restart ArgoCD Server: Delete the Argo CD server pods to force them to restart and reinitialize with the original password from the secret:
kubectl delete pods -n argocd -l app.kubernetes.io/name=argocd-server
 
  1. Verify the Password: Retrieve and decode the initial admin password to ensure it has been reset correctly:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d