简体   繁体   English

Prometheus EKS集群监控

[英]Prometheus EKS Cluster monitoring

I have a eks cluster in a public subnet. 我在公共子网中有一个eks群集。 Prometheus server is running on an ec2 instance in the same subnet. Prometheus服务器在同一子网中的ec2实例上运行。 I am unable to find a way to monitor this cluster on prometheus. 我无法找到一种在Prometheus上监视此群集的方法。 Are there any configurations I might be missing? 我可能会缺少任何配置吗? Please suggest what checks I should do. 请提出我应该做的检查。 Could not find any blog/doc that could help resolve my problem. 找不到任何有助于解决我的问题的博客/文档。

You need to get the base64 token which has access to kubernetes api, which you can get it from secrets. 您需要获取可访问kubernetes api的base64令牌,您可以从秘密中获取它。 your configuration should look like this, ofcourse the base64 token will be big this is just dummy one. 您的配置应如下所示,当然base64令牌将很大,这只是一个虚拟对象。

- job_name: ekscluster
  kubernetes_sd_configs:
  - role: node
    api_server: https://ekscluster.sk1.us-east-1.eks.amazonaws.com
    tls_config:
       insecure_skip_verify: true
    bearer_token: "asdaaasdakjfafua09famdn23423sxfsdd3e2342"

  bearer_token: "asdaaasdakjfafua09famdn23423sxfsdd3e2342"
  scheme: https
  tls_config:
    insecure_skip_verify: true
  relabel_configs:
  - separator: ;
    regex: __meta_kubernetes_node_label_(.+)
    replacement: $1
    action: labelmap
  - separator: ;
    regex: (.*)
    target_label: __address__
    replacement: ekscluster.sk1.us-east-1.eks.amazonaws.com
    action: replace
  - source_labels: [__meta_kubernetes_node_name]
    separator: ;
    regex: (.+)
    target_label: __metrics_path__
    replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
    action: replace

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

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