addons: Use service endpoints to scrape node-exporter

This commit is contained in:
Dalton Hubble 2017-10-22 21:29:31 -07:00
parent ec1dbb853c
commit b608f9c615
3 changed files with 7 additions and 13 deletions

View File

@ -101,18 +101,6 @@ data:
target_label: __metrics_path__ target_label: __metrics_path__
replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor replacement: /api/v1/nodes/${1}/proxy/metrics/cadvisor
# Scrape config for node-exporter endpoints (e.g. 'node_'). Explore metrics
# from a host running a node-exporter by scraping (127.0.0.1:9100/metrics).
- job_name: 'node-exporters'
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: monitoring;node-exporter;metrics
# Scrape config for service endpoints. # Scrape config for service endpoints.
# #
# The relabeling allows the actual service scrape endpoint to be configured # The relabeling allows the actual service scrape endpoint to be configured

View File

@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1 apiVersion: apps/v1beta2
kind: DaemonSet kind: DaemonSet
metadata: metadata:
name: node-exporter name: node-exporter
@ -8,6 +8,10 @@ spec:
type: RollingUpdate type: RollingUpdate
rollingUpdate: rollingUpdate:
maxUnavailable: 1 maxUnavailable: 1
selector:
matchLabels:
name: node-exporter
phase: prod
template: template:
metadata: metadata:
labels: labels:

View File

@ -3,6 +3,8 @@ kind: Service
metadata: metadata:
name: node-exporter name: node-exporter
namespace: monitoring namespace: monitoring
annotations:
prometheus.io/scrape: 'true'
spec: spec:
type: ClusterIP type: ClusterIP
# service is created to allow prometheus to scape endpoints # service is created to allow prometheus to scape endpoints