#安装教程如下

git clone https://github.com/coreos/kube-prometheus.git --depth=
#替换镜像地址为国内微软仓库 
cp -r kube-prometheus{,.bak} 
cat kube-prometheus/manifests/* | grep image: 
sed -i 's#quay.io#quay.azk8s.cn#g' kube-prometheus/manifests/* 
sed -i 's#k8s.gcr.io#gcr.azk8s.cn/google_containers#g' kubeprometheus/manifests/* 

cd /root/kube-prometheus/manifests/setup
kubectl apply -f .
cd /root/kube-prometheus/manifests
kubectl apply -f .
kubectl get crd |grep coreos
kubectl get pods -n monitoring
kubectl get svc -n monitoring
kubectl edit svc grafana -n monitoring
#ClusterIP修改成NodePort
kubectl edit svc prometheus-k8s -n monitoring
#ClusterIP修改成NodePort
#导入模版
点+号 > Import > https://grafana.com/grafana/dashboards/315
点+号 > Import > https://grafana.com/grafana/dashboards/8919