skip to Main Content

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

7

Answers


  1. 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.

    Login or Signup to reply.
  2. 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
    
    Login or Signup to reply.
  3. 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.

    Login or Signup to reply.
  4. 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"

    Login or Signup to reply.
  5. To change the password, edit the argocd-secret secret and update the admin.password field with a new bcrypt hash.

    Login or Signup to reply.
  6. 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

    Login or Signup to reply.
  7. 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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search