Docker 单机安装 rancher2.7.7导入自定义集群时一直不成功 [Disconnected] Cluster agent is not connected

Rancher Server 设置

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

下游集群信息

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

用户信息

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

主机操作系统:

问题描述:
通过docker安装的rancher server 导入自有集群一直不成功
重现步骤:

结果:

预期结果:

截图:

其他上下文信息:

[details=“日志”]

2024/08/15 05:11:00 [INFO] error in remotedialer server [400]: websocket: close 1006 (abnormal closure): unexpected EOF
W0815 05:11:00.225571      33 reflector.go:348] pkg/mod/github.com/rancher/client-go@v1.25.4-rancher1/tools/cache/reflector.go:170: watch of *v1.ClusterRole ended with: an error on the server ("unable to decode an event from the watch stream: tunnel disconnect") has prevented the request from succeeding


W0815 06:01:06.003891      34 reflector.go:425] pkg/mod/github.com/rancher/client-go@v1.25.4-rancher1/tools/cache/reflector.go:170: failed to list *v1.Node: Get "https://192.168.0.1:443/api/v1/nodes?resourceVersion=147586898": cluster agent disconnected

agent一直处在  
time="2024-08-15T06:04:08Z" level=info msg="Connecting to proxy" url="wss://域名/v3/connect/register"

[/details]bucn

rancher前端的nginx配置可以贴出来看看

部署使用docker 我的证书放在rancher里面 导入的时候是直接到rancher的 不经过nginx这一层

可能需要完整的cluster-agent日志

INFO: Environment: CATTLE_ADDRESS=ip CATTLE_CA_CHECKSUM= CATTLE_CLUSTER=true CATTLE_CLUSTER_AGENT_PORT=tcp://192.168.217.85:80 CATTLE_CLUSTER_AGENT_PORT_443_TCP=tcp://192.168.217.85:443 CATTLE_CLUSTER_AGENT_PORT_443_TCP_ADDR=192.168.217.85 CATTLE_CLUSTER_AGENT_PORT_443_TCP_PORT=443 CATTLE_CLUSTER_AGENT_PORT_443_TCP_PROTO=tcp CATTLE_CLUSTER_AGENT_PORT_80_TCP=tcp://192.168.217.85:80 CATTLE_CLUSTER_AGENT_PORT_80_TCP_ADDR=192.168.217.85 CATTLE_CLUSTER_AGENT_PORT_80_TCP_PORT=80 CATTLE_CLUSTER_AGENT_PORT_80_TCP_PROTO=tcp CATTLE_CLUSTER_AGENT_SERVICE_HOST=192.168.217.85 CATTLE_CLUSTER_AGENT_SERVICE_PORT=80 CATTLE_CLUSTER_AGENT_SERVICE_PORT_HTTP=80 CATTLE_CLUSTER_AGENT_SERVICE_PORT_HTTPS_INTERNAL=443 CATTLE_CLUSTER_REGISTRY=harbor.app.prd CATTLE_INGRESS_IP_DOMAIN=sslip.io CATTLE_INSTALL_UUID=7776ec39-ac2b-4fb6-9a9c-b1279df52705 CATTLE_INTERNAL_ADDRESS= CATTLE_IS_RKE=false CATTLE_K8S_MANAGED=true CATTLE_NODE_NAME=cattle-cluster-agent-7d56fdf5d7-tf4p4 CATTLE_RANCHER_WEBHOOK_MIN_VERSION= CATTLE_RANCHER_WEBHOOK_VERSION=2.0.6+up0.3.6 CATTLE_SERVER=https://域名 CATTLE_SERVER_VERSION=v2.7.7
INFO: Using resolv.conf: search cattle-system.svc.cluster.local svc.cluster.local cluster.local nameserver 169.254.20.10 options ndots:5
INFO: https://域名/ping is accessible
INFO: 域名 resolves to ip
time=“2024-08-15T05:34:23Z” level=info msg=“Listening on /tmp/log.sock”
time=“2024-08-15T05:34:23Z” level=info msg=“Rancher agent version v2.7.7 is starting”
time=“2024-08-15T05:34:23Z” level=info msg=“Connecting to wss://域名/v3/connect/register with token starting with dvb6hnjdh77xzf28pgzwmnmqwxd”
time=“2024-08-15T05:34:23Z” level=info msg=“Connecting to proxy” url=“wss://域名/v3/connect/register”

这个跟下面 wss://域名/v3/connect/register 对应的IP是一样的吗?

不一致 这是为啥

不一致 多次注册ip还不一样 一直变

不清楚,但按道理应该需要一致,我们现有的环境中都是一致的,可能无法简单解决