首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >度量-服务器:节点没有匹配类型的地址[InternalIP]

度量-服务器:节点没有匹配类型的地址[InternalIP]
EN

Stack Overflow用户
提问于 2021-05-19 11:58:45
回答 1查看 91关注 0票数 0

我使用Rancher 2.5.8来管理我的Kubernetes集群。今天,我创建了一个新的集群,除了度量服务器之外,一切都按预期运行。度量-服务器的状态总是"CrashLoopBackOff“,日志告诉我如下:

代码语言:javascript
复制
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的输出

代码语言:javascript
复制
status:
  addresses:
  - address: worker1
    type: Hostname
  - address: 65.21.<any>.<ip>
    type: ExternalIP
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-05-31 06:48:18

问题在于度量服务器。

度量服务器配置为使用kubelet-preferred-address-types=InternalIP,但工作节点没有列出任何InternalIP:

代码语言:javascript
复制
$ 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 (来源)那样配置它:

代码语言:javascript
复制
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname

度量-服务器配置文档中的As状态

-kubelet-首选地址-类型-在确定连接到特定节点的地址时使用的节点地址类型的优先级(默认主机名、InternalDNS、InternalIP、ExternalDNS、ExternalIP)

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67602829

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档