【发布时间】:2021-09-16 13:56:33
【问题描述】:
一段时间以来,我们一直很乐意将 ArgoCD 与公共存储库一起使用,但在尝试将 ArgoCD 连接到私有存储库时遇到了问题。我们有一个Application,看起来像这样:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: example-app
namespace: argocd
spec:
destination:
name: example-cluster
namespace: open-cluster-management-agent
project: ops
source:
path: .
repoURL: ssh://git@github.com/example-org/example-repo.git
targetRevision: HEAD
syncPolicy:
automated:
prune: true
selfHeal: true
syncOptions:
- Validate=false
- ApplyOutOfSyncOnly=true
还有一个对应的秘钥,秘钥如下:
apiVersion: v1
metadata:
labels:
argocd.argoproj.io/secret-type: repository
name: example-repo
namespace: argocd
type: Opaque
stringData:
sshPrivateKey: |
-----BEGIN OPENSSH PRIVATE KEY-----
...
-----END OPENSSH PRIVATE KEY-----
url: ssh://git@github.com/example-org/example-repo.git
kind: Secret
ArgoCD 无法同步此应用并显示以下错误:
rpc error: code = Unknown desc = error creating SSH agent: "SSH agent
requested but SSH_AUTH_SOCK not-specified"
我明白这告诉我什么,但我不知道如何更正 ArgoCD 上下文中的问题。
【问题讨论】:
-
似乎是 ssh-only,而不是真正的 Git。不过有点奇怪,ssh代理请求什么?
-
我认为这可能是版本偏差;我们正在运行 argocd 2.0.x,我认为这些文档是针对较新版本的。我今天要检查版本适当的文档,看看两者之间是否发生了变化。
标签: git kubernetes ssh argocd gitops