Thanos-Query/Query-Frontend 不显示任何指标
基本上,我已经使用提供的 helm 从 kube-prometheus-stack 安装了 Prometheus-Grafana图表存储库 prometheus-community
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack
他们工作正常。
但我现在面临的问题是将 Thanos 与现有的 kube-prometheus-stack 集成。
我从 bitnami Helm Chart 存储库 安装了 Thanos
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install thanos bitnami/thanos
我可以加载 Thanos 查询前端 GUI,但是那里没有显示任何指标。
我现在正在努力让它正常工作。是因为来自完全不同的 Helm Chart 的 Thanos 和来自另一个 Helm Chart 的 Prometheus-operator-grafana 堆栈吗?
我在 AWS 上的 Kubernetes 集群是使用 Kops 创建的。而且,我使用 Gitlab pipeline 和 helm 将应用程序部署到集群。
Basically, I had installed Prometheues-Grafana from the kube-prometheus-stack using the provided helm chart repo prometheus-community
# helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
# helm install kube-prometheus-stack prometheus-community/kube-prometheus-stack
They are working fine.
But the problem I am facing now is integrating Thanos with this existing kube-prometheus-stack.
I installed thanos from the bitnami helm chart repo
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install thanos bitnami/thanos
I can load the Thanos Query Frontend GUI, but no metrics showing there.
I am struggling now to get it worked properly. Is it because of Thanos from a completely different helm chart and Prometheus-operator-grafana stack from another helm chart ?.
My Kubernetes cluster on AWS has been created using Kops. And, I use Gitlab pipeline and helm to deploy apps to the cluster.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
仅仅安装它们是不够的,您需要将
prometheus
与thanos
集成。下面我将描述获得结果所需执行的所有步骤。
第一个短理论。集成它们的最常见方法是使用
thanos sidecar
容器作为prometheus
pod。您可以在此处阅读更多信息。这是如何完成的:
(考虑到安装是干净的,可以轻松删除并从头开始重新安装)。
thanos sidecar
添加到prometheus
pod。拉取 kube-prometheus-stack 图表:
您将拥有一个包含图表的文件夹。您需要修改
values.yaml
,准确地说是两个部分:请记住,此功能仍处于实验阶段:
完成后,安装带有编辑过的
values.yaml
的prometheus
图表:并检查 sidecar 是否已部署:
它应该有 3 个容器正在运行(默认情况下为 2 个)。您可以使用 kubectl describe 命令更详细地检查它。
thanos
图表并部署它。拉出
thanos
图表:编辑
values.yaml
:使用编辑后的
values.yaml
保存并安装此图表:检查其是否有效:
我们感兴趣在这一行中:
值得一读的好文章:
It's not enough to simply install them, you need to integrate
prometheus
withthanos
.Below I'll describe all steps you need to perform to get the result.
First short theory. The most common approach to integrate them is to use
thanos sidecar
container forprometheus
pod. You can read more here.How this is done:
(considering that installation is clean, it can be easily deleted and reinstalled from the scratch).
thanos sidecar
added to theprometheus
pod.Pull
kube-prometheus-stack
chart:You will have a folder with a chart. You need to modify
values.yaml
, two parts to be precise:Keep in mind, this feature is still experimental:
Once it's done, install the
prometheus
chart with editedvalues.yaml
:And check that sidecar is deployed as well:
It should be 3 containers running (by default it's 2). You can inspect it in more details with
kubectl describe
command.thanos
chart and deploy it.Pull the
thanos
chart:Edit
values.yaml
:Save and install this chart with edited
values.yaml
:Check that it works:
We are interested in this line:
Good article to read:
Yuo 不需要更改 Thanos Sidecar pod 名称。
您可以在安装 prometheus 的命名空间中找到 prometheus-kube-prometheus-thanos-discovery。例如,如果您安装在 monitoring 命名空间中,请运行 kubectl get svc -n reporting。
还要确保您在thanos helm值文件的sidecarsNamespce字段下指定了正确的命名空间。
Yuo don't need to change thanos sidecar pod name.
You can find the prometheus-kube-prometheus-thanos-discovery in the namespace you installed prometheus. For example, if you installed in monitoring namespace, run kubectl get svc -n monitoring.
Also ensure that you have specified the correct namespace under the sidecarsNamespce field in the thanos helm values file.