【发布时间】:2020-10-20 20:36:28
【问题描述】:
首先对使用 helm 有点陌生...
所以我很难得到这个的掌舵部署:https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
在我的 kubernetes 集群中按照我想要的方式工作。我喜欢它到目前为止所做的事情,但我怎样才能让它刮掉一个自定义端点?我看过这个:https://github.com/prometheus-community/helm-charts/tree/main/charts/prometheus
在标题为:“通过注释抓取 Pod 指标”的部分下。我在 kubernetes 的 pod 部署(然后是节点端口服务)中添加了以下注释:
annotations = {
"prometheus.io/scrape" = "true"
"prometheus.io/path" = "/appMetrics/prometheusMetrics"
"prometheus.io/port" = "443"
}
但是,当我查看 prometheus 的 targets 页面时,我看不到它。我也没有在配置文件中看到它。所以这让我觉得这个 helm 图表没有部署相同的 prometheus 图表。
所以现在的问题是,如何使用 helm chart kube-prometheus-stack 设置自定义抓取端点。从我的阅读来看,这是我应该*使用的,对吧?
【问题讨论】:
-
我正在和你做同样的事情。我也通过 helm 安装 kube-prometheus-stack。从 prometheus 配置 (prometheus.io/docs/prometheus/latest/configuration/…) 可以看出,我们可以将 global/rule_files/scrape_config 添加到 prometheus.yml 中。但是,我尝试将它们添加到掌舵图的 values.yaml 中,但没有运气。还有一个叫github.com/prometheus-community/helm-charts/tree/main/charts/…的舵图,不确定是否应该使用它。 (我正在为 HPA 做一些研究)
-
我还尝试添加 helm 暴露值
additionalScrapeConfigsSecret和additionalScrapeConfigsSecret,但没有成功。似乎它完全忽略了这些值。其他人实际上在这里打开了一个关于此的问题:github.com/prometheus-operator/prometheus-operator/issues/3608
标签: kubernetes prometheus kubernetes-helm