Kubernetes1.22 安装 prometheus 及自定义暴露指标 grafana

添加prometheus-community到repo

helm repo add prometheus-community https://prometheus-community.github.io/helm-charts

 更新repo

helm repo update

创建命名空间

kubectl create ns prometheus-stack

安装

helm -n prometheus-stack install  kube-prometheus-stack prometheus-community/kube-prometheus-stack

 安装完成效果如下图:

什么是服务发现?

我们在每个节点上面都运行了 node-exporter,如果我们通过一个 Service 来将数据收集到一起用静态配置的方式配置到 Prometheus 去中,就只会显示一条数据,我们得自己在指标数据中去过滤每个节点的数据,当然我们也可以手动的把所有节点用静态的方式配置到 Prometheus 中去,但是以后要新增或者去掉节点的时候就还得手动去配置,那么有没有一种方式可以让 Prometheus 去自动发现我们节点的 node-exporter 程序,并且按节点进行分组呢?这就是 Prometheus 里面非常重要的「服务发现」功能。

配置参考链接:https://prometheus.io/docs/prometheus/latest/configuration/configuration/

创建自动发现规则

我们定义的 Prometheus 的配置如下 prometheus-a

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值