ArgoCD通过ssh ed25519连接私有非标准端口仓库

使用SSH RSA 算法和git@192.168.31.41:35022/group1/demo-ops.git 方式在部署应用的时候会遇到异常:

Unable to create application: application spec for demo is invalid: InvalidSpecError: Unable to generate manifests in demo: rpc error: code = Internal desc = Failed to fetch default: `git fetch origin --tags --force --prune` failed exit status 128: Warning: Permanently added '192.168.31.41' (ED25519) to the list of known hosts. Permission denied, please try again. Permission denied, please try again. git@192.168.31.41: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

解决办法:

使用ssh ed25519 加密算法和

ssh://git@192.168.31.41:35022/group1/demo-ops.git

仓库连接地址。

原因参考官方文档:

Private Repositories - Argo CD - Declarative GitOps CD for Kubernetes

Private repositories that require a username and password typically have a URL that start with https:// rather than git@ or ssh://.

Note

Argo CD 2.4 upgraded to OpenSSH 8.9. OpenSSH 8.8 dropped support for the ssh-rsa SHA-1 key signature algorithm. See the 2.3 to 2.4 upgrade guide for details about testing SSH servers for compatibility with Argo CD and for working around servers that do not support newer algorithms.

https://www.openssh.com/txt/release-8.8

ssh-rsa sha-1 证书不被支持。

When your SSH repository is served from a non-standard port, you have to use ssh://-style URLs to specify your repository. The scp-style git@yourgit.com:yourrepo URLs do not support port specification, and will treat any port number as part of the repository's path.


不能使用git@192.168.31.41:35022 格式来增加端口号,而是 ssh://git@192.168.31.41:35022/group1/demo-ops.git

Git 证书设置办法:

对应的git仓库创建对应的depoly keys,depoly keys的详细说明可以参考gitlab的官方文档。depoly keys可以在gitlab的仓库的Settings -> Repository -> Deploy keys找到,然后把刚刚生成的key里面的公钥放进去即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值