Is it possible to set the admin password decoratively as possible as installing the argo cd app?
For example, can we use a K8s secret?
Right now it looks like there is an API and CLI to change the password.
Might also be useful to be able to set the password via the UI.
It looks like the password might be stored in the secret argocd-server but when I tried decoding it
kubectl -n argocd get secret argocd-secret -o json | jq -r '.data["admin.password"]' | base64 -d
I didn't get a working password. The default password as described in the docs here works.
As you observed, the argocd-secret Secret is where we store the password. However, we don't store plain-text password strings (base64 or otherwise). The password is bcrypted and the original value cannot be retrieved from the hash alone.
Since this is standard bcrypt, you can use any number of bcrypt tools to generate a bcrypt hash that will validate a preferred password string:
https://unix.stackexchange.com/questions/307994/compute-bcrypt-hash-from-command-line
This will let you populate the admin.password key of the argocd-sercret with a preferred password.
Thank you.
For anyone stumbling on this question, to get the current value:
kubectl get secret -n argocd argocd-secret -o json | \
jq '.data|to_entries|map({key, value:.value|@base64d})|from_entries'
To set a new password:
kubectl patch secret -n argocd argocd-secret \
-p '{"stringData": { "admin.password": "'$(htpasswd -bnBC 10 "" newpassword | tr -d ':\n')'"}}'
The default password is only working until the pod name is the same. Pod names are not stable, so having the pod name as the default password is bad. (Of course not using a proper OAuth provider is bad aswell..., so touche).
I ran into the issue of the pod name changing (did an update of the deployment) and couldn't log in anymore, so I had to have a way of changing the password.
I'd like to know how to use the user setup via htpasswd (UPI OpenShift install, ArgoCD setup via Operator). I tried the default admin account but was not able to setup an application (all kinds of permission/rbac issues). Is it possible to use htpasswd provider with ArgoCD?
Most helpful comment
For anyone stumbling on this question, to get the current value:
To set a new password:
The default password is only working until the pod name is the same. Pod names are not stable, so having the pod name as the default password is bad. (Of course not using a proper OAuth provider is bad aswell..., so touche).
I ran into the issue of the pod name changing (did an update of the deployment) and couldn't log in anymore, so I had to have a way of changing the password.