Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refuse

[root@k8s-master01 ~]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS      MESSAGE                                                                                       ERROR
controller-manager   Unhealthy   Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refused   
scheduler            Unhealthy   Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused   
etcd-0               Healthy     {"health":"true"}

原因是kube-controller-manager.yaml和kube-scheduler.yaml设置的默认端口是0,在文件中注释掉就可以了。

在每台master节点执行

vim /etc/kubernetes/manifests/kube-scheduler.yaml
将
- --port=0
这行注释掉
vim /etc/kubernetes/manifests/kube-controller-manager.yaml
将
- --port=0
这行注释掉

重启kubelet

systemctl restart kubelet.service

再次查看

[root@k8s-master01 ~]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME                 STATUS    MESSAGE             ERROR
controller-manager   Healthy   ok                  
scheduler            Healthy   ok                  
etcd-0               Healthy   {"health":"true"} 
上一篇:【java规则引擎】《Drools7.0.0.Final规则引擎教程》第4章 4.5RHS语法


下一篇:Tomcat定义日志