From 473dd5b89a51b1486f1f1658c3532647d7f8ce74 Mon Sep 17 00:00:00 2001 From: Jimmi Dyson Date: Thu, 10 Nov 2016 09:46:36 +0000 Subject: [PATCH] Kubernetes SD: Add endpoints role to API servers job to actually discover some API servers --- documentation/examples/prometheus-kubernetes.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/documentation/examples/prometheus-kubernetes.yml b/documentation/examples/prometheus-kubernetes.yml index 9c7b3b95d..55669e827 100644 --- a/documentation/examples/prometheus-kubernetes.yml +++ b/documentation/examples/prometheus-kubernetes.yml @@ -6,9 +6,18 @@ # `labelmap` relabeling action. # Scrape config for API servers. +# +# Kubernetes exposes API servers as endpoints to the default/kubernetes +# service so this uses `endpoints` role and uses relabelling to only keep +# the endpoints associated with the default/kubernetes service using the +# default named port `https`. This works for single API server deployments as +# well as HA API server deployments. scrape_configs: - job_name: 'kubernetes-apiservers' + kubernetes_sd_configs: + - role: endpoints + # Default to scraping over https. If required, just disable this or change to # `http`. scheme: https