From 5770d9e545002d00083898d35d151ccf1493e3da Mon Sep 17 00:00:00 2001 From: beorn7 Date: Tue, 29 Nov 2016 18:42:35 +0100 Subject: [PATCH] Kubernetes SD: More fixes to example config - Avoid mentioning the `in_cluster` option. (It doesn't exist anymore.) - Replace `__meta_kubernetes_service_namespace` and `__meta_kubernetes_pod_namespace` (which don't exist anymore) by `__meta_kubernetes_namespace`. --- documentation/examples/prometheus-kubernetes.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/documentation/examples/prometheus-kubernetes.yml b/documentation/examples/prometheus-kubernetes.yml index 55669e827..6d5f7165e 100644 --- a/documentation/examples/prometheus-kubernetes.yml +++ b/documentation/examples/prometheus-kubernetes.yml @@ -24,8 +24,10 @@ scrape_configs: # This TLS & bearer token file config is used to connect to the actual scrape # endpoints for cluster components. This is separate to discovery auth - # configuration (`in_cluster` below) because discovery & scraping are two - # separate concerns in Prometheus. + # configuration because discovery & scraping are two separate concerns in + # Prometheus. The discovery auth config is automatic if Prometheus runs inside + # the cluster. Otherwise, more config options have to be provided within the + # . tls_config: ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt # If your node certificates are self-signed or use a different CA to the @@ -53,8 +55,10 @@ scrape_configs: # This TLS & bearer token file config is used to connect to the actual scrape # endpoints for cluster components. This is separate to discovery auth - # configuration (`in_cluster` below) because discovery & scraping are two - # separate concerns in Prometheus. + # configuration because discovery & scraping are two separate concerns in + # Prometheus. The discovery auth config is automatic if Prometheus runs inside + # the cluster. Otherwise, more config options have to be provided within the + # . tls_config: ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt # If your node certificates are self-signed or use a different CA to the @@ -108,7 +112,7 @@ scrape_configs: replacement: $1:$2 - action: labelmap regex: __meta_kubernetes_service_label_(.+) - - source_labels: [__meta_kubernetes_service_namespace] + - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_service_name] @@ -175,7 +179,7 @@ scrape_configs: target_label: __address__ - action: labelmap regex: __meta_kubernetes_pod_label_(.+) - - source_labels: [__meta_kubernetes_pod_namespace] + - source_labels: [__meta_kubernetes_namespace] action: replace target_label: kubernetes_namespace - source_labels: [__meta_kubernetes_pod_name]