k8s二进制部署系列10-检查k8s集群状态

1.1 检查master服务状态

[root@k8s-master ~]# systemctl status kube-apiserver.service kube-controller-manager.service kube-scheduler.service  | grep active
   Active: active (running) since Thu 2018-07-12 23:25:50 CST; 1 day 11h ago
   Active: active (running) since Thu 2018-07-12 23:25:42 CST; 1 day 11h ago
   Active: active (running) since Thu 2018-07-12 23:25:42 CST; 1 day 11h ago

1.2 检查node服务状态

[root@k8s-node01 ~]# systemctl status kubelet.service kube-proxy.service | grep active
   Active: active (running) since Thu 2018-07-12 23:27:07 CST; 1 day 11h ago
   Active: active (running) since Thu 2018-07-12 23:27:07 CST; 1 day 11h ago

1.3 检查节点状态

[root@k8s-master ~]# kubectl get nodes
NAME         STATUS    ROLES     AGE       VERSION
k8s-node01   Ready     <none>    1d        v1.10.4
k8s-node02   Ready     <none>    1d        v1.10.4

1.4 检查集群状态

提示:由于controller-manager关闭了http访问端口,故此处显示Unhealthy状态,不影响正常使用。
[root@k8s-master ~]# kubectl get cs
NAME                 STATUS      MESSAGE                                                                                                                                  ERROR
controller-manager   Unhealthy   Get http://127.0.0.1:10252/healthz: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"
scheduler            Healthy     ok
etcd-2               Healthy     {"health":"true"}
etcd-1               Healthy     {"health":"true"}
etcd-0               Healthy     {"health":"true"}
  • 说明:
  • 执行kubectl get componentstatuses 命令时,apiserver 默认向0.0.1 发送请求。当 controller-manager、scheduler 以集群模式运行时,有可能和 kube-apiserver 不在一台机器上,这时 controller-manager 或 scheduler 的状态为 Unhealthy,但实际上它们工作正常
温馨提示:本文最后更新于2022-12-20 20:57:47,已超过523天没有更新。某些文章具有时效性,若文章内容或图片资源有错误或已失效,请联系站长。谢谢!
转载请注明本文链接:https://blog.leonshadow.cn/763482/1210.html
© 版权声明
THE END
喜欢就支持一下吧
点赞0 分享