argo-cd: Unable to use ssh gitlab connection for on prem gitlab
We wanted to use argocd with our on prem gitlab. Our gitlab is using self signed cert, so decided to use ssh instead.
But i keep getting this error ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
If anyone have an idea on how to get past this one.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 21 (15 by maintainers)
I see this issue myself when using SSH + declarative setup, what was the fix @balchua?
Since I ran into the same problem today while trying to add a private repo from my GitLab instance via SSH (AND host key verification) in a declarative way to my ArgoCD running in Minikube, I’ll share my solution:
Generate a SSH keypair for Argo without a password (
ssh-keygen -t ed25519 -N '' -C argo@minikube -f ed25519_delme)Add it as a (read only) deploy key to the GitLab repo
From the declarative doc, take the argocd-repositories.yaml manifest, add the git SSH clone
url, thesshPrivateKey(fromed25519_delme), adaptnameand removeusernameandpasswordAppend the host key fingerprints from
ssh-keyscan git.example.org 2> /dev/nullto the argocd-ssh-known-hosts-cm.yaml manifestssh_known_hostsblock, as well as adding the ArgoCDnamespace:kubectl apply -f argocd-ssh-known-hosts-cm.yamlandkubectl apply -f argocd-repositories.yaml. Now the ArgoCD web UI should report a🗹 Successfulconnection to the repo and work.I hope this helps anyone 😉
🎉 Multiple Private Repos in Gitlab - Shared SSH Key -
Prefixed ssh://ssh://repos for pattern matching the URLs🔧 Shared Gitlab Secret for an Org
🔧 Declare the app with URL (substring)