我目前正在使用Prometheus来刮削Kubernetes组件。我只能抓住豆荚,而不是节点。我按照官方文档编写配置文件。我添加了" prometheus.io/scrape=true"节点的注释。它仍然没有用。应该有哪些其他符号。这是配置文件。
- job_name: "kubernetes-nodes"
# The URL scheme with which to fetch metrics from targets.
scheme: https
# Optional TLS configuration.
tls_config:
# Disable validation of the server certificate.
insecure_skip_verify: true
kubernetes_sd_configs:
- api_servers:
- https://kubernetes.default.svc
role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: kubernetes.default.svc:443
- source_labels: [__meta_kubernetes_node_name]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics
我浏览了prometheus日志,这是错误 -
level=error msg="Cannot initialize nodes collection: unable to list Kubernetes nodes: unable to query any API servers: Get https://kubernetes.default.svc/api/v1/nodes: x509: certificate signed by unknown authority" source="node.go:124"