1,故障现象 查看状态存在不健康组件
[root@beian k8s]# 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"}
2,解决办法
[root@beian k8s]# cd /etc/kubernetes/manifests/
[root@beian manifests]# ls
etcd.yaml kube-apiserver.yaml kube-controller-manager.yaml kube-scheduler.yaml
[root@beian manifests]# vim kube-controller-manager.yaml
[root@beian manifests]# vim kube-scheduler.yaml
以上两个文件注释掉
- --port=0
[root@beian manifests]# systemctl restart kubelet.service
[root@beian manifests]# 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"}