Kubernetes SD: Update example config to use endpoints role for API server discovery

This commit is contained in:
Jimmi Dyson 2016-11-02 20:48:01 +00:00
parent 4d37dca669
commit da23543f29
No known key found for this signature in database
GPG key ID: 978CD4AF4C1E87F5

View file

@ -28,9 +28,13 @@ scrape_configs:
# insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
static_configs:
- targets:
- kubernetes.default.svc
# Keep only the default/kubernetes service endpoints for the https port. This
# will add targets for each API server which Kubernetes adds an endpoint to
# the default/kubernetes service.
relabel_configs:
- source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name]
action: keep
regex: default;kubernetes;https
- job_name: 'kubernetes-nodes'