SSH key scan for host https://gitlab.host.com failed, error: dial tcp: lookup tcp///gitlab.host.com: getaddrinfow: The specified class was not foun

SSH key scan for host https://gitlab.host.com failed, error: dial tcp: lookup tcp///gitlab.host.com: getaddrinfow: The specified class was not foun

我正在尝试使用私人 GitLab 存储库设置 FluxCD。这是我用来在 Kubernetes 集群上安装 Flux 并将其配置为从 Git 存储库管理自身的命令。

flux bootstrap gitlab --hostname=https://gitlab.host.com  --owner=devops --namespace=namespace --repository=my-repo --branch=master --interval=30s --path=clusters/Cluster1

这是我对上述命令得到的响应:

► connecting to https://gitlab.host.com
► cloning branch "master" from Git repository "https://gitlab.host.com/devops/aks-kubernetes.git"
✔ cloned repository
► generating component manifests
✔ generated component manifests
✔ component manifests are up to date
► installing components in "mynamespace" namespace
✔ installed components
✔ reconciled components
► determining if source secret "mynamespace/flux-system" exists
► generating source secret
✗ SSH key scan for host https://gitlab.host.com failed, error: dial tcp: lookup tcp///gitlab.host.com: getaddrinfow: The specified class was not found.

我不确定为什么会在这个阶段收到此错误。 Flux 能够连接到 git 并提交清单文件 - gotk-components.yaml。我可以在我的仓库中看到这个文件。任何帮助将非常感激。谢谢

您还需要使用 --ssh-hostname 参数并提供您公司的 ssh 主机。所以 flux 会自动在你的 repo 中创建和添加部署密钥。请参考助焊剂文档。 https://fluxcd.io/docs/installation/#gitlab-and-gitlab-enterprise 在身份验证部分下。

所以命令应该是这样的:-

flux bootstrap gitlab --hostname=https://gitlab.host.com --ssh-hostname gitlab.host.com --owner=devops --namespace=namespace --repository=my-repo --branch=master --interval=30s --path=clusters/Cluster1