How to reset ArgoCD admin user password

Did you happen to forget your ArgoCD admin login password? In older versions of ArgoCD, v1.8 and earlier, the default admin password was set to set to the name of the server pod. For ArgoCD version 1.9 and later, the initial password is saved as a secret during the installation. The secret is is called argocd-initial-admin-secret.

Getting initial admin password from a secret

If you never changed the default admin user password, it can be pulled from the secret by executing the following commands:

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d;echo

The output will be the admin user password in plain text, for example:

RGfpwaAvhnh14Krl

For admin account with no password change in the past, the output can be copied and used to login to ArgoCD.

Resetting admin user password

If you want the ArgoCD server to autogenerate a new password and update the secret, then delete the admin.password and admin.passwordMtime keys from the argocd-secret secret.

kubectl -n argocd get secret argocd-secret -o yaml

This can be done using the kubectl patch command or by editing the secret directly. Here’s how to do it from CLI using patch command option.

  • By nulling:
kubectl -n argocd patch secret argocd-secret  -p '{"data": {"admin.password": null, "admin.passwordMtime": null}}' -n argocd
  • Or by removing them keys
kubectl -n argocd patch secret argocd-secret \
  --type=json \
  -p='[{"op": "remove", "path": "/data/admin.password"}, {"op": "remove", "path": "/data/admin.passwordMtime"}]'

You should get the output:

secret/argocd-secret patched

Restart argocd server after password is regenerated

kubectl -n argocd rollout restart deployment argocd-server

Wait for the pod to get ready

kubectl -n argocd get pods

Then retrieve generated password (this updated argocd-initial-admin-secret)

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d;echo

Sample output:

-D0EQT3Qok3ZapYX

Update admin password from ArgoCD UI

Access ArgoCD web interface, e.g by using port forwarding if no ingress is configured in your setup

# If using HTTP
kubectl -n argocd port-forward --address 0.0.0.0 service/argocd-server 8080:80

# If using HTTPS
kubectl -n argocd port-forward --address 0.0.0.0 service/argocd-server 8443:443

Login with admin as username, and regenerated password.

Click on “User Info” –> “UPDATE PASSWORD” to set your own custom password for the admin user.

Once you’ve provided and confirmed the new password, click save to update it.

Test your new password by logging out and then logging back in. Our Engineers are available to support you in your GitOps journey, contact us today for a free consultation.

Your IT Journey Starts Here!

Ready to level up your IT skills? Our new eLearning platform is coming soon to help you master the latest technologies.

Be the first to know when we launch! Join our waitlist now.

Join our Linux and open source community. Subscribe to our newsletter for tips, tricks, and collaboration opportunities!

Recent Post

Leave a Comment

Your email address will not be published. Required fields are marked *

Related Post

Welcome to our today’s tutorial on how to search text files using regular expressions like grep, egrep, fgrep, sed, regex. […]

In this guide, we show you how to manage files and permissions on Linux. The core security feature of Linux […]

Normally when backing data in a computer locally or to the cloud, there has been a struggle to get the […]

Let's Connect

Unleash the full potential of your business with CloudSpinx. Our expert solutions specialists are standing by to answer your questions and tailor a plan that perfectly aligns with your unique needs.
You will get a response from our solutions specialist within 12 hours
We understand emergencies can be stressful. For immediate assistance, chat with us now

Contact CloudSpinx today!

Download CloudSpinx Profile

Discover the full spectrum of our expertise and services by downloading our detailed Company Profile. Simply enter your first name, last name, and email address.