我使用Rancher 2.5.8来管理我的Kubernetes集群。今天,我创建了一个新的集群,除了度量服务器之外,一切都按预期运行。度量-服务器的状态总是"CrashLoopBackOff“,日志告诉我如下:
E0519 11:46:39.225804 1 server.go:132] unable to fully scrape metrics: [unable to fully scrape metrics from node worker1: unable to fetch metrics from node worker1: unable to extract connection information for node "worker1": node worker1 had no addresses that matched types [InternalIP], unable to fully scrape metrics from node worker2: unable to fetch metrics from node worker2: unable to extract connection information for node "worker2": node worker2 had no addresses that matched types [InternalIP], unable to fully scrape metrics from node worker3: unable to fetch metrics from node worker3: unable to extract connection information for node "worker3": node worker3 had no addresses that matched types [InternalIP], unable to fully scrape metrics from node main1: unable to fetch metrics from node main1: unable to extract connection information for node "main1": node main1 had no addresses that matched types [InternalIP]]
I0519 11:46:39.228205 1 requestheader_controller.go:169] Starting RequestHeaderAuthRequestController
I0519 11:46:39.228222 1 shared_informer.go:240] Waiting for caches to sync for RequestHeaderAuthRequestController
I0519 11:46:39.228290 1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0519 11:46:39.228301 1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0519 11:46:39.228310 1 configmap_cafile_content.go:202] Starting client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0519 11:46:39.228314 1 shared_informer.go:240] Waiting for caches to sync for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0519 11:46:39.229241 1 secure_serving.go:197] Serving securely on [::]:4443
I0519 11:46:39.229280 1 dynamic_serving_content.go:130] Starting serving-cert::/tmp/apiserver.crt::/tmp/apiserver.key
I0519 11:46:39.229302 1 tlsconfig.go:240] Starting DynamicServingCertificateController
I0519 11:46:39.328399 1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::requestheader-client-ca-file
I0519 11:46:39.328428 1 shared_informer.go:247] Caches are synced for client-ca::kube-system::extension-apiserver-authentication::client-ca-file
I0519 11:46:39.328505 1 shared_informer.go:247] Caches are synced for RequestHeaderAuthRequestController有没有人知道我如何解决这个问题,这样度量服务器就不会再崩溃了?
这是kubectl get nodes worker1 -oyaml的输出
status:
addresses:
- address: worker1
type: Hostname
- address: 65.21.<any>.<ip>
type: ExternalIP发布于 2021-05-31 06:48:18
问题在于度量服务器。
度量服务器配置为使用kubelet-preferred-address-types=InternalIP,但工作节点没有列出任何InternalIP:
$ kubectl get nodes worker1 -oyaml:
[...]
status:
addresses:
- address: worker1
type: Hostname
- address: 65.21.<any>.<ip>
type: ExternalIP解决方案是在度量服务器部署yaml中设置--kubelet-preferred-address-types=ExternalIP。
但是,更好的解决方案可能是像官方度量服务器部署yaml (来源)那样配置它:
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname度量-服务器配置文档中的As状态
-kubelet-首选地址-类型-在确定连接到特定节点的地址时使用的节点地址类型的优先级(默认主机名、InternalDNS、InternalIP、ExternalDNS、ExternalIP)
https://stackoverflow.com/questions/67602829
复制相似问题