Waiting for API to be available

Rancher Server 设置

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

下游集群信息

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

用户信息

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

问题描述:
安装 rancher2.6.6,然后创建集群,名字为:dev
当注册机器后,集群一直提示:Waiting for API to be available
重现步骤:






注册机器:
sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.6.6 --server https://rancher.nuc11.local --token hzhxg9tx42m8hhk9wz7x2hgv7zr5dcjjmt266nwnbnw6t74pvdj9hh --ca-checksum 2f72d62afb44df644fea7992224548ff518fbad4628c72a85f3ff9bff282ab20 --etcd --controlplane --worker
结果:
Waiting for API to be available

预期结果:
集群状态可用
截图:

其他上下文信息:

日志

rancher 日志

2022/07/10 01:10:10 [ERROR] error parsing azure-group-cache-size, skipping update strconv.Atoi: parsing "": invalid syntax
2022/07/10 01:10:10 [INFO] getReleaseConfig: reloading config for k3s
2022/07/10 01:10:10 [INFO] getReleaseConfig: reloading config for rke2
2022/07/10 01:10:10 [INFO] Starting cluster controllers for c-z4wh2
2022/07/10 01:10:10 [INFO] Starting cluster controllers for c-z4wh2
2022/07/10 01:10:10 [INFO] Starting cluster.cattle.io/v3, Kind=ClusterAuthToken controller
2022/07/10 01:10:10 [ERROR] error parsing azure-group-cache-size, skipping update strconv.Atoi: parsing "": invalid syntax
2022/07/10 01:10:10 [INFO] Starting cluster.cattle.io/v3, Kind=ClusterUserAttribute controller
2022/07/10 01:10:11 [INFO] driverMetadata: refreshing data from upstream https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json
2022/07/10 01:10:11 [INFO] Retrieve data.json from local path /var/lib/rancher-data/driver-metadata/data.json
2022/07/10 01:10:11 [INFO] Refreshing driverMetadata in 1440 minutes
2022/07/10 01:10:12 [INFO] Loaded configuration from https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json in [0x6f5d780]
2022/07/10 01:10:12 [INFO] getReleaseConfig: reloading config for k3s
2022/07/10 01:10:12 [INFO] Loaded configuration from https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json in [0x6f5d780]
2022/07/10 01:10:12 [INFO] getReleaseConfig: reloading config for rke2
2022/07/10 01:10:12 [INFO] driverMetadata: refreshing data from upstream https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json
2022/07/10 01:10:12 [INFO] Retrieve data.json from local path /var/lib/rancher-data/driver-metadata/data.json
2022/07/10 01:10:12 [INFO] Loaded configuration from https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json in [0x6f5d780]
2022/07/10 01:10:12 [INFO] Loaded configuration from https://releases.rancher.com/kontainer-driver-metadata/release-v2.6/data.json in [0x6f5d780]
W0710 01:40:43.804877      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:43.932403      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:43.979333      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:43.980416      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:43.981538      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:44.904270      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.039904      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.039927      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.418155      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.418292      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.486083      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.486512      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.489346      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 01:40:45.668823      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.581502      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.581933      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582082      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582112      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582163      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582180      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582201      51 transport.go:288] Unable to cancel request for *client.addQuery
W0710 02:10:52.582223      51 transport.go:288] Unable to cancel request for *client.addQuery

apiserver 日志

I0710 01:08:11.016903       1 controller.go:611] quota admission added evaluator for: leases.coordination.k8s.io
I0710 01:08:11.876757       1 controller.go:132] OpenAPI AggregationController: action for item k8s_internal_local_delegation_chain_0000000000: Nothing (removed from the queue).
I0710 01:08:11.880184       1 storage_scheduling.go:109] all system priority classes are created successfully or already exist.
I0710 01:08:13.169519       1 controller.go:611] quota admission added evaluator for: events.events.k8s.io
E0710 01:08:15.980542       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": context deadline exceeded (Client.Timeout exceeded while awaiting headers)
E0710 01:08:20.983466       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
E0710 01:08:21.995583       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:24.999792       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:28.005824       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:31.012690       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:34.019850       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:37.025661       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
E0710 01:08:40.031495       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
I0710 01:08:40.439720       1 controller.go:611] quota admission added evaluator for: endpoints
I0710 01:08:40.450687       1 controller.go:611] quota admission added evaluator for: endpointslices.discovery.k8s.io
I0710 01:08:40.450687       1 controller.go:611] quota admission added evaluator for: endpointslices.discovery.k8s.io
E0710 01:08:41.997343       1 controller.go:116] loading OpenAPI spec for "v1beta1.metrics.k8s.io" failed with: failed to retrieve openAPI spec, http error: ResponseCode: 503, Body: error trying to reach service: dial tcp 10.43.192.152:443: i/o timeout
, Header: map[Content-Type:[text/plain; charset=utf-8] X-Content-Type-Options:[nosniff]]
I0710 01:08:41.997364       1 controller.go:129] OpenAPI AggregationController: action for item v1beta1.metrics.k8s.io: Rate Limited Requeue.
E0710 01:08:43.037477       1 available_controller.go:524] v1beta1.metrics.k8s.io failed with: failing or missing response from https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1: Get "https://10.43.192.152:443/apis/metrics.k8s.io/v1beta1": dial tcp 10.43.192.152:443: connect: no route to host
W0710 01:08:44.039905       1 handler_proxy.go:104] no RequestInfo found in the context
E0710 01:08:44.039974       1 controller.go:116] loading OpenAPI spec for "v1beta1.metrics.k8s.io" failed with: failed to retrieve openAPI spec, http error: ResponseCode: 503, Body: service unavailable
, Header: map[Content-Type:[text/plain; charset=utf-8] X-Content-Type-Options:[nosniff]]
I0710 01:08:44.040003       1 controller.go:129] OpenAPI AggregationController: action for item v1beta1.metrics.k8s.io: Rate Limited Requeue

https://127.0.0.1:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

在提供下 rancher agent 的日志