26

I have installed argocd on aks using below command:

kubectl create namespace argocd
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/master/manifests/install.yaml

Then I change it to load balancer service.

kubectl edit svc argocd-server -n argocd

Now, when I connect to argocd web ui, I wasm't able to connect with below credentials.

user: admin password: argocd-server-9b77b6575-ts54n

Password got from below command as mentioned in docs.

kubectl get po -n argocd
NAME                                 READY   STATUS    RESTARTS   AGE
argocd-application-controller-0      1/1     Running   0          21m
argocd-dex-server-5559bc9679-5mj4v   1/1     Running   1          21m
argocd-redis-74d8c6db65-sxbnt        1/1     Running   0          21m
argocd-repo-server-6866f58df-m59sr   1/1     Running   0          21m
argocd-server-9b77b6575-ts54n        1/1     Running   0          21m

Please suggest me how to login, what is the default credentials.

Even I tried resetting it using this command.

kubectl -n argocd patch secret argocd-secret -p '{"stringData": {
    "admin.password": "$2a$10$Ix3Pd7mywOwVWOK8eSSY0uo60V6Vf6DtZljGuLwGRHQNnWNBbOLhW",
    "admin.passwordMtime": "'$(date +%FT%T%Z)'"
  }}'

But getting this error:

Error from server (BadRequest): invalid character 's' looking for beginning of object key string
Error from server (NotFound): secrets "2021-07-08T12:59:15IST" not found
Error from server (NotFound): secrets "\n  }}" not found
uday
  • 569
  • 1
  • 6
  • 16

8 Answers8

82

You get the password by typing

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

With kubectl get pods you get the pod name, not the password. It is common that applications save the password into a Kubernetes Secret. The secret values are base64 encoded, so to update the secret it has to be valid base64 echo newpassword | base64. Allthough keep in mind updating the secret does not change the application password.

BMW
  • 42,880
  • 12
  • 99
  • 116
Pierre
  • 1,409
  • 12
  • 15
18

user: admin

To get the password, type the command below:

kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
quoc9x
  • 1,423
  • 2
  • 9
  • 26
5

Visit https://github.com/argoproj/argo-cd/blob/master/docs/faq.md

#bcrypt(password)=$2a$10$rRyBsGSHK6.uc8fntPwVIuLVHgsAhAX7TcdrqW/RADU0uh7CaChLa
kubectl -n argocd patch secret argocd-secret \
  -p '{"stringData": {
    "admin.password": "$2a$10$rRyBsGSHK6.uc8fntPwVIuLVHgsAhAX7TcdrqW/RADU0uh7CaChLa",
    "admin.passwordMtime": "'$(date +%FT%T%Z)'"
  }}'

your new password is "password"

userM1433372
  • 5,345
  • 35
  • 38
4

Using tools like Rancher or Lens (or OpenLens), you can see the secrets.

You may find the Argocd admin password is in a argocd-initial-admin-secret secret (at least for Argocd v2.3.3) :

OpenLens : Find Argocd admin password using OpenLens

Rancher : Find Argocd admin password using Rancher

Yann39
  • 14,285
  • 11
  • 56
  • 84
1

A solution to this (Local ArgoCD setup)

  1. Patch secret to update password.
kubectl -n argocd patch secret argocd-secret  -p '{"data": {"admin.password": null, "admin.passwordMtime": null}}'

That will reset the password to the pod name.

  1. Restart the api-server pod. Do this by scaling the pod replica to zero and then back to one.
kubectl -n argocd scale deployment argocd-server --replicas=0

once scaled-down, make sure to scale back up and wait a few minutes before

kubectl -n argocd scale deployment argocd-server --replicas=1
  1. New password of the ArgoCD will be your api-server pod name with the numbers at the end name (kubectl -n argocd get po >> to find pod name)

i.e login:

  • user: admin
  • pass: argocd-server-6cdb9b4b84-jvl58

That should work.

mabukar
  • 19
  • 3
0

To change the password, edit the argocd-secret secret and update the admin.password field with a new bcrypt hash.

0

Initial password could also be retrieved using the argocd CLI. Related documentation

  • Install the CLI (in Mac using homebrew):
brew install argocd

Installation instructions for other platforms are here

  • Get the initial password
argocd admin initial-password -n argocd
0

If you're running ArgoCD > 1.9 then you can reset your admin password by patching argocd-secret

kubectl -n argocd patch secret argocd-secret \
-p '{"stringData": {"admin.password": "'$(htpasswd -bnBC 10 "" <adminpwd> | tr -d ':\n' | sed 's/$2y/$2a/')'", "admin.passwordMtime": "'$(date +%FT%T%Z)'"}}'

replace <adminpwd> with your admin password.

It requires you to have htpasswd

sabertooth1990
  • 1,048
  • 1
  • 13
  • 19