添加自定义集群 cluster-agent 启动错误问题

Rancher Server 设置

  • Rancher 版本: 2.5.16
  • 安装选项 (Docker install/Helm Chart): helm
    • 如果是 Helm Chart 安装,需要提供 Local 集群的类型(RKE1, RKE2, k3s, EKS, 等)和版本:
  • 在线或离线部署: 在线

下游集群信息

  • Kubernetes 版本: 1.20.15
  • Cluster Type (Local/Downstream):
    • 如果 Downstream,是什么类型的集群?(自定义/导入或为托管 等):

用户信息

  • 登录用户的角色是什么? (管理员/集群所有者/集群成员/项目所有者/项目成员/自定义):
    • 如果自定义,自定义权限集:

主机操作系统: 欧拉

问题描述:

重现步骤:

结果:

预期结果:

大家有没有成功加入自定义集群的案例啊 一直有这方面的苦恼

截图:
添加自定义集群

执行命令
curl --insecure -sfL https://182.92.159.125:32042/v3/import/8jgdjxxh47dbkmcz4w6zm6p9sjtltnzbvpx4rt2fd2kq7pl7sl6md9_c-qpvsm.yaml | kubectl apply -f -

image
查看pod 日志


time=“2022-12-07T11:37:33Z” level=error msg=“Issuer of last certificate found in chain (CN=dynamiclistener-ca,O=dynamiclistener-org) does not match with CA certificate Issuer (CN=cattle-ca,C=CN). Please check if the configured server certificate contains all needed intermediate certificates and make sure they are in the correct order (server certificate first, intermediates after)”
time=“2022-12-07T11:37:33Z” level=fatal msg=“Certificate chain is not complete, please check if all needed intermediate certificates are included in the server certificate (in the correct order) and if the cacerts setting in Rancher either contains the correct CA certificate (in the case of using self signed certificates) or is empty (in the case of using a certificate signed by a recognized CA). Certificate information is displayed above. error: Get “https://182.92.159.125:32042”: x509: certificate signed by unknown authority”

其他上下文信息:

日志


你的 rancher 应该使用 helm 搭建的,使用 helm 安装 rancher 时会指定一个 hostname,用于访问 rancher manager。同时,这个 hostname 也用于注册或导入节点或集群。

从你的日志来看,你使用 nodeport 将 rancher 的端口开放出来用于访问,但使用 nodeport 导入集群时,跳过了 ingress 的证书验证。

所以,请使用 helm 安装 rancher 时所使用的 hostname 地址进行导入集群。