本节重点介绍 :
检查,kube-system ns
[root@prome-master01 prometheus]# kubectl get pod -n kube-system
NAME READY STATUS RESTARTS AGE
coredns-7d75679df-7f7tx 1/1 Running 0 88m
coredns-7d75679df-qmzbg 1/1 Running 0 88m
etcd-prome-master01 1/1 Running 0 88m
kube-apiserver-prome-master01 1/1 Running 0 88m
kube-controller-manager-prome-master01 1/1 Running 0 88m
kube-proxy-48dwz 1/1 Running 0 87m
kube-proxy-gmvvn 1/1 Running 0 88m
kube-scheduler-prome-master01 1/1 Running 0 88m
kube-state-metrics-647444dd74-h4tfk 1/1 Running 0 3m6s
prometheus-0 2/2 Running 0 87s
## 6. 使用node的ip:8091即可访问prometheus服务
```shell
curl localhost:8091
7. 排查问题
- 容器基础资源和node kubelet metrics采集报403错误,现象如下
- 解决方案 rbac.yaml resource添加 node/metrics即可
- kube-scheduler和kube-controller-manager 采集报错,如下
- 原因是因为 上述两个服务bind的地址是127.0.0.1 ,修改成0.0.0.0即可
vim /etc/kubernetes/manifests/kube-scheduler.yaml
vim /etc/kubernetes/manifests/kube-controller-manager.yaml
-bind-address=0.0.0.0
最终的效果图
本节重点总结 :
- 准备好这些yaml文件
- 部署ksm
- 部署prometheus