【问题标题】:monitor kuberntes cluster which created using kops with prometheus running on different vpc监控使用 kops 创建的 kubernetes 集群,prometheus 在不同的 vpc 上运行
【发布时间】:2018-02-02 14:33:23
【问题描述】:

我使用 kops 在 aws 上创建了一个 kubernetes 集群,因此它自己创建了证书。 所以接下来就是在prometheus配置中添加kubernetes api server。 我使用了下面的 prometheus 配置。

 - role: node
  api_server: 'https://example.com'
  basic_auth:
    username: 'username'
    password: 'password'
  tls_config:
    ca_file: '/opt/prometheus-2.1.0.linux-amd64/ca.crt'
    server_name: kubernetes

它正在 prometheus 中添加目标,但 prometheus 无法报废目标,并出现以下错误。

Get https://x.x.x.x:10250/metrics: x509: cannot validate certificate for x.x.x.x because it doesn't contain any IP SANs

尽管我在上面的配置中添加了 server_name: kubernetes。 我从证书中获取了 kubernetes。

openssl x509 -text -noout -in ca.crt

它有以下内容。 主题:CN=kubernetes

【问题讨论】:

  • 如果我理解正确,prometheus 可以连接到 API 并获取所有节点。但它不能自己刮节点?

标签: kubernetes prometheus kops prometheus-operator


【解决方案1】:

试试这个。用于使用 ansible 设置 Kubernetes 集群。 这将配置 AWS ec2 并设置集群。此角色包括许多足以用于开发集群的插件 [1]:https://github.com/khann-adill/kubernetes-ansible

【讨论】:

  • 采用一种完全不同的方式来维护 k8s 集群对于这个问题来说可能有点矫枉过正。
猜你喜欢
  • 1970-01-01
  • 2020-03-26
  • 2020-08-01
  • 1970-01-01
  • 2020-01-19
  • 2021-05-14
  • 2019-07-31
  • 2020-05-05
  • 2020-05-06
相关资源
最近更新 更多