鲁花花生油
作者鲁花花生油2020-07-06 22:49
系统运维工程师, 联众

参照《容器云平台的集群高可用安装部署及配置.pdf》出现的问题

字数 2182阅读 1453评论 2赞 3

[root@rhel7-01 ~]# kubectl get cs

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-2 Healthy {"health":"true"}

etcd-0 Healthy {"health":"true"}

etcd-1 Healthy {"health":"true"}

## controller-manage 和 scheduler 状态为 Unhealthy

controller-manage 服务是正常运行状态

[root@rhel7-01 ~]# systemctl status kube-controller-manager.service |grep active
Active: active (running) since Mon 2020-07-06 22:14:32 CST; 29min ago

scheduler 服务配置好了启动失败

[root@rhel7-01 ~]# systemctl status kube-scheduler.service

● kube-scheduler.service - Kubernetes Scheduler

Loaded: loaded (/etc/systemd/system/kube-scheduler.service; enabled; vendor preset: disabled)

Active: inactive (dead) (Result: exit-code) since Mon 2020-07-06 22:03:37 CST; 30min ago

Docs: https://github.com/GoogleCloudPlatform/kubernetes

Process: 7919 ExecStart=/opt/k8s/bin/kube-scheduler --config=/etc/kubernetes/kube-scheduler.yaml --bind-address=172.16.10.21 --secure-port=10259 --port=0 --tls-cert-file=/etc/kubernetes/cert/kube-scheduler.pem --tls-private-key-file=/etc/kubernetes/cert/kube-scheduler-key.pem --authentication-kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig --client-ca-file=/etc/kubernetes/cert/ca.pem --requestheader-allowed-names="" --requestheader-client-ca-file=/etc/kubernetes/cert/ca.pem --requestheader-extra-headers-prefix="X-Remote-Extra-" --requestheader-group-headers=X-Remote-Group --requestheader-username-headers=X-Remote-User --authorization-kubeconfig=/etc/kubernetes/kube-scheduler.kubeconfig --logtostderr=true --v=2 (code=exited, status=1/FAILURE)

Main PID: 7919 (code=exited, status=1/FAILURE)

Jul 06 22:03:36 rhel7-01.redhat.com systemd[1]: kube-scheduler.service: main process exited, code=exited, status=1/FAILURE

Jul 06 22:03:36 rhel7-01.redhat.com systemd[1]: Unit kube-scheduler.service entered failed state.

Jul 06 22:03:36 rhel7-01.redhat.com systemd[1]: kube-scheduler.service failed.

Jul 06 22:03:37 rhel7-01.redhat.com systemd[1]: Stopped Kubernetes Scheduler.

各位大佬帮忙看看怎么解决

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

3

添加新评论2 条评论

#rule安全工程师, 互联网
2020-08-16 04:42
确认kube-scheduler和kube-controller-manager组件配置是否禁用了非安全端口 配置文件路径:/etc/kubernetes/manifests/scheduler.conf 、/etc/kubernetes/manifests/controller-manager.conf 去掉--port=0这个设置,然后重启sudo systemctl restart kubelet
#zhsa云架构师, 大型金融单位
2020-07-08 22:16
可以按照如下思路排查 1、controller-manager和scheduler两个组件,均需要依赖apiserver,先检查apiserver是否正常 systemctl status kube-apiserver |grep 'Active:' # 查看日志 journalctl -u kube-apiserver # 检查集群状态 kubectl cluster-info # 端口是否监听 netstat -tnlp | grep 6443 2、检查10251及10252端口,是否在127.0.0.1这个地址上监听,有可能是在其他的网卡地址 netstat -tnlp | grep -E '10251|10252' 3、 kube-scheduler服务启动失败,需要看日志有没有什么异常 journalctl -u kube-scheduler

鲁花花生油@zhsa 多谢,我再试试

2020-07-14 12:58
Ctrl+Enter 发表

容器云管理平台选型优先顺序调查

发表您的选型观点,参与即得50金币。