记录&分享K8s Gitlab Prometheus搭建过程。
Helm使k8s基建部署变成一件很容易的事。
1 helm安装
1 2 3 4 5
| $ helm repo add prometheus-community https://prometheus-community.github.io/helm-charts $ helm repo update
$ k create ns prome $ helm install -n prome prome -f prom-values.yaml prometheus-community/prometheus
|
参考values.yaml
1 2 3 4 5 6
| server: persistentVolume: storageClassName: gp2 size: 40Gi statefulSet: enabled: true
|
2 验证
pod metadata 增加annotations,自动采集指标。
1 2 3 4 5
| metadata: annotations: prometheus.io/path: /metrics prometheus.io/port: "6000" prometheus.io/scrape: "true"
|
登录grafana,配置promethues源,查看指标。
参考资料