$ git clone --depth=1 [email protected]:prometheus-operator/kube-prometheus
替换 k8s.gcr.io
镜像
-
k8s.gcr.io/kube-state-metrics/kube-state-metrics:v2.3.0
-
ccr.ccs.tencentyun.com/gcr-mirror/kube-state-metrics:v2.3.0
-
k8s.gcr.io/prometheus-adapter/prometheus-adapter:v0.9.1
-
ccr.ccs.tencentyun.com/gcr-mirror/prometheus-adapter:v0.9.1
# https://github.com/prometheus-operator/kube-prometheus/issues/1533
$ kubectl apply -f kube-prometheus/manifests/setup --server-side
# 等待 20s
$ kubectl apply -f kube-prometheus/manifests/
服务通过 ingress 暴露,WEB 访问各个服务请查看 ingress
文件夹中 ingress
配置。
$ kubectl apply -k ingress
- grafana 用户名
admin
密码admin
参考 storage/local-path
$ kubectl apply -k kustomize/storage
查看 monitoring-demo
文件夹内容
监控其他命名空间必须应用 RBAC,可以参考 monitoring-demo/istiod/rbac.yaml