【问题标题】:ArgoCD failing to sync with "SSH agent requested but SSH_AUTH_SOCK not-specified"ArgoCD 无法与“已请求 SSH 代理但未指定 SSH_AUTH_SOCK”同步
【发布时间】: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


【解决方案1】:

您可以从argoproj/argo-cd issue 1172查看可能的原因

既然您有正确的 URL(ssh://git@github.com/...,应PR 203 的要求),请仔细检查缩进:

这是我在repositories.yaml 中引起的识别问题:)导致错误的解组和空的sshPrivateKeySecret
正确的版本在这里:

- sshPrivateKeySecret:
   key: sshPrivateKey
   name: bitbucket
 url: git@bitbucket.org:MY-PROJECT/MY-REPO

【讨论】:

    猜你喜欢
    • 2022-01-27
    • 2016-02-06
    • 2022-09-25
    • 2015-02-02
    • 2016-02-14
    • 1970-01-01
    • 2023-04-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多