在本地 Kubernetes 集群中使用 Kafka Exporter 的 HPA [英] HPA using Kafka Exporter in on premise Kubernetes cluster

查看:32
本文介绍了在本地 Kubernetes 集群中使用 Kafka Exporter 的 HPA的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在尝试使用来自 Kafka-exporter 的 Metrics 来实现 Kubernetes HPA.Hpa 支持 Prometheus,因此我们尝试将指标写入 prometheus 实例.从那里开始,我们不清楚要执行的步骤.有没有文章详细解释一下?

I had been trying to implement Kubernetes HPA using Metrics from Kafka-exporter. Hpa supports Prometheus, so we tried writing the metrics to prometheus instance. From there, we are unclear on the steps to do. Is there an article where it will explain in details ?

我关注了 https://medium.com/google-cloud/kubernetes-hpa-autoscaling-with-kafka-metrics-88a671497f07

在 GCP 中也是如此,我们使用了堆栈驱动程序,并且实现的效果非常棒.但是,我们在内部部署方面遇到了困难,因为堆栈驱动程序需要被 Prometheus 替换

for same in GCP and we used stack driver, and the implementation worked like a charm. But, we are struggling in on-premise setup, as stack driver needs to be replaced by Prometheus

推荐答案

当我使用 Kafka-exporter 的 Metrics 实现 Kubernetes HPA 时,我遇到了一些挫折,我通过以下方式解决了:

When I implemented Kubernetes HPA using Metrics from Kafka-exporter I had a few setbacks which I solved doing the following:

  1. 我将 kafka-exporter 容器作为 sidecar 部署到我的 Pod 中想要扩展.我发现 HPA 会缩放它获得的 pod指标来自.
  2. 我使用了 注释 使 Prometheus 使用导出器从 pod 中抓取指标.

  1. I deployed the kafka-exporter container as a sidecar to the pods I wanted to scale. I found that the HPA scales the pod it gets the metrics from.
  2. I used annotations to make Prometheus scrape the metrics from the pods with exporter.

然后我验证了 kafka-exporter 指标正在到达 Prometheus.如果它不存在,您就无法进一步前进.

Then I verified that the kafka-exporter metrics are getting to Prometheus. If it's not there you can't advance further.

这是解释的完整指南如何使用来自 Kafka-exporter 的 Metrics 实现 Kubernetes HPA

如果有更多问题请评论

这篇关于在本地 Kubernetes 集群中使用 Kafka Exporter 的 HPA的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆