简体   繁体   English

使用 Prometheus 从其他 Kubernetes 集群监控 Kubernetes 集群

[英]Monitor Kubernetes Cluster from other Kubernetes cluster with Prometheus

I have run several Kubernetes Clusters on Azure AKS, so I intend to create Centralized Monitoring Cluster run on other Kubernetes cluster with Prometheus-Grafana.我已经在 Azure AKS 上运行了多个 Kubernetes 集群,因此我打算使用 Prometheus-Grafana 创建在其他 Kubernetes 集群上运行的集中监控集群

集中监控

My idea is that:我的想法是:

  • Isolating & centralizing monitoring cluster.隔离和集中监控集群。
  • In case of any cluster is downed, Monitoring cluster is still alive to inspect downed cluster.如果任何集群被关闭,监控集群仍然活着以检查关闭的集群。
  • Run cross-cloud provider Kubernetes (if available)运行跨云提供商 Kubernetes(如果可用)

I'm confusing about connecting clusters, network, ingress, how does Prometheus discovery, pull metric from outside cluster...我对连接集群、网络、入口、Prometheus 如何发现、从集群外部提取指标感到困惑……

Is there any best practice, instruction for my usecase.是否有任何最佳实践,我的用例说明。 Thank you!谢谢!

Yes, Prometheus is a very flexible monitoring solution wherein each Prometheus server is able to act as a target for another Prometheus server.是的,Prometheus 是一个非常灵活的监控解决方案,其中每个 Prometheus 服务器都能够充当另一个 Prometheus 服务器的目标。 Using prometheus federation, Prometheus servers can scrape selected time series data from other Prometheus servers.使用 prometheus federation,Prometheus 服务器可以从其他 Prometheus 服务器中抓取选定的时间序列数据。

A typical Prometheus federation example configuration looks like this:

- job_name: 'federate'
  scrape_interval: 15s

  honor_labels: true
  metrics_path: '/federate'

  params:
    'match[]':
      - '{job="prometheus"}'
      - '{__name__=~"job:.*"}'

  static_configs:
    - targets:
      - 'source-prometheus-1:9090'
      - 'source-prometheus-2:9090'
      - 'source-prometheus-3:9090'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM