用prometheus查询外部etd

时间:2018-02-16 00:38:10

标签: kubernetes prometheus etcd

如文档所述,我已经使用以下scrape配置在kubernetes上运行了prometheus。 .pem文件位于prometheus容器内的磁盘上。

https://prometheus.io/docs/prometheus/latest/configuration/configuration/#

scrape_configs:
- job_name: etcd
  static_configs:
  - targets: ['10.0.0.222:2379','10.0.0.221:2379','10.0.0.220:2379']
  tls_config:
  # CA certificate to validate API server certificate with.
    ca_file: /prometheus/ca.pem
    cert_file: /prometheus/cert.pem
    key_file: /prometheus/key.pem

我认为etd是prometheus中的一个目标,但是它的返回垃圾。

https://i.imgur.com/rdRI4V7.png

我可以通过传递客户端证书信息来点击执行本地卷曲的指标端点。

我做错了什么?

sudo curl --cacert /etc/ssl/etcd/ssl/ca.pem https://127.0.0.1:2379/metrics -L --cert /etc/ssl/etcd/ssl/node-kubemaster-rwva1-prod-2.pem --key /etc/ssl/etcd/ssl/node-kubemaster-rwva1-prod-2-key.pem^C

1 个答案:

答案 0 :(得分:4)

您需要为HTTPS抓取添加scheme: https