Kubernetes – 如何暴露Kafka Exporter

huangapple go评论53阅读模式
英文:

Kubernetes - how to expose Kafka Exporter

问题

我想使用外部的Prometheus服务器监控我的Kafka集群。
我已成功在我的Kubernetes集群上启动了一个带有Kafka Exporter的Kafka集群,但在Strimzi配置文件中,我找不到暴露Kafka Exporter节点的选项。
我找到的唯一选项是:https://strimzi.io/docs/operators/latest/configuring.html#type-KafkaExporterSpec-reference

是否已经有人这样做过或有任何想法?

英文:

I would like to monitor my kafka cluster with an external prometheus server.
I successfully launch a Kafka cluster with Kafka Exporter on my kubernetes cluster, but in Strimzi configuration file, I do not find an option to expose the kafka exporter node.
There is the only options I found : https://strimzi.io/docs/operators/latest/configuring.html#type-KafkaExporterSpec-reference

Someone already do this or have an idea ?

答案1

得分: 0

在 Strimzi 中没有内置的支持。但你可以创建自己的服务(或者例如 Ingress 资源)来实现这一点。

需要注意的是:

  • 请记住,度量指标端点没有以任何方式进行安全保护。因此,这将暴露(潜在的)机密信息,例如主题名称或消费者组名称。它还可能被用于某些形式的 DoS 攻击。因此,你可能不希望将其公开发布,应该考虑其安全性方面。
  • Kafka Exporter 只是指标的一小部分。其他指标由 Kafka 经纪人或 ZooKeeper 节点提供。因此,你可能需要暴露它们的所有内容。

总的来说,我认为在这种情况下的一种常见模式是在本地收集指标,而不是公开暴露它们,然后将指标转发到远程 Prometheus 指标。我认为 Prometheus Agent 和 Prometheus Federation 可能会在这方面提供帮助,还有一些其他工具。因此,我认为你应该考虑这个方案。

英文:

There is no built-in support for this in Strimzi. But you can create your own services (and/or Ingress resources for example) to do that.

That said:

  • Keep in mind that the metrics endpoints are not secured in any way. So this will expose (potentially) confidential information such as topic names or consumer group names. It could be also used for some forms of DoS attacks. So you probably don't want to make it publicly available just like that and should consider the security aspect of this.
  • The Kafka Exporter is just a small part of the metrics. Other metrics are provided by the Kafka brokers or ZooKeeper nodes. So you might need to expose all of them.

Overall, I think a common pattern for a situation like this is to collect the metrics locally instead of exposing them and then forward the metrics to the remote Prometheus metrics. I think the Prometheus Agent and Prometheus Federation might help with this as well as some other tools. So I think this is something you should consider instead.

huangapple
  • 本文由 发表于 2023年3月7日 22:11:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75663076.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定