Cattle-fleet-local-system下的fleet-agent无法解析rancher server配置的域名

  • Rancher 版本:v2.9.2

  • 安装选项 (Docker install):

  • 在线或离线部署:在线

  • 登录用户的角色是什么? 管理员

**主机操作系统:centos7.4

问题描述:

设置rancher server域名后,local集群下的 fleet-agent 初始化失败,日志显示无法解析域名

重现步骤:
docker安装
docker run -d --restart=unless-stopped --privileged
-p 80:80 -p 443:443
-e CATTLE_SYSTEM_DEFAULT_REGISTRY=registry.cn-hangzhou.aliyuncs.com
-e CATTLE_BOOTSTRAP_PASSWORD=rancher@123456
-e TZ=Asia/Shanghai
-v /opt/docker/rancher:/var/lib/rancher
-v /etc/hosts:/etc/hosts
–name rancher
registry.cn-hangzhou.aliyuncs.com/rancher/rancher:v2.9.2

启动后登录页面配置rancherserver域名


有试过配置主机别名,还是一样的报错

截图:

其他上下文信息:

日志
time="2024-10-15T02:36:57Z" level=error msg="Failed to register agent: registration failed: cannot create clusterregistration on management cluster for cluster id 'xwqgh9v4wm5gl65znrtng9hc2z8c7xtcv8zzmpttw9th4vwtnf7xbh': Post \"https://rancher.b.com/apis/fleet.cattle.io/v1alpha1/namespaces/fleet-local/clusterregistrations\": dial tcp: lookup rancher.b.com on 10.43.0.10:53: no such host