# Prometheus+Grafana监控
因为有时候网络拉镜像可能会有延迟拉不下来,所以在这里可以提前准备镜像在本地。
相关镜像准备:
gcr.io/google_containers/kube-state-metrics:v0.5.0
prom/prometheus:v1.7.0
prom/node-exporter:v0.14.0
giantswarm/tiny-tools
dockermuenster/caddy:0.9.3
grafana/grafana:4.2.0
quay.io/prometheus/alertmanager:v0.7.1
访问专属harbor下载所有镜像,harbor地址如下:
http://harbor.ttlinux.com.cn/harbor/sign-in
将上述镜像下载到本地后,使用docker load命令加载到Kubernetes每台Node节点上。
```
root@a3:/opt/kubernetes/bin# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
k8s.gcr.io/kubernetes-dashboard-amd64 v1.10.0 0dab2435c100 7 days ago 122MB
giantswarm/tiny-tools latest 8c5f0fb345a6 5 months ago 26.1MB
quay.io/prometheus/alertmanager v0.7.1 822973257511 14 months ago 17.7MB
prom/prometheus v1.7.0 bb25f19f9142 14 months ago 74.5MB
gcr.io/google_containers/kube-state-metrics v0.5.0 5981204fed57 15 months ago 45.6MB
grafana/grafana 4.2.0 8c4ef64b4ad1 17 months ago 278MB
prom/node-exporter v0.14.0 bb4a6b774658 17 months ago 18.9MB
dockermuenster/caddy 0.9.3 f883ac96868d 23 months ago 33.2MB
gcr.io/google-containers/pause-amd64 3.0 99e59f495ffa 2 years ago 747kB
```
官方拉取镜像:
普罗米修斯yaml文件
wget https://raw.githubusercontent.com/giantswarm/kubernetes-prometheus/master/manifests-all.yaml
kubectl create -f . 创建
kubectl get service -n kube-system. 查看服务爆漏的端口
页面访问:
http://localhost:port
# Grafana:
![](https://box.kancloud.cn/19768392be3f449544f8f917db0e200b_2164x1438.png)
# Prometheus:
![](https://box.kancloud.cn/4ea00c251afcef73ec7ef82b79ad862d_2878x1452.png)