一段时间以来,我们一直很高兴地将 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 的上下文中纠正这个问题。