Argo CD: Retrieve Initial Admin Password

When you first install Argo CD, an initial admin password is automatically generated and stored as a Kubernetes secret. This command allows you to retrieve that password to log into the Argo CD UI for the first time.

Command to Retrieve Password

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

Command Breakdown:

  • kubectl -n argocd: Executes the kubectl command within the argocd namespace.
  • get secret argocd-initial-admin-secret: Retrieves the secret named argocd-initial-admin-secret. This secret contains the auto-generated admin password.
  • -o jsonpath="{.data.password}": This extracts the password field from the data section of the secret, using JSONPath. The password is base64 encoded within the secret.
  • | base64 -d: Pipes the base64 encoded password to base64 -d to decode it.
  • && echo: Adds a newline character after the decoded password for cleaner output.

After running this command, the decoded password will be printed to your terminal, which you can then use to log into the Argo CD web interface with the username admin.