【发布时间】: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