diff --git a/prometheus/files/prometheus.yml b/prometheus/files/prometheus.yml index e7652f3..a94d5a3 100644 --- a/prometheus/files/prometheus.yml +++ b/prometheus/files/prometheus.yml @@ -98,6 +98,7 @@ scrape_configs: {%- if server.get('target', {}).get('kubernetes', {}).get('enabled', False) %} {%- set kubernetes_target = server.target.kubernetes %} + - job_name: 'kubernetes-api' scheme: https tls_config: @@ -116,7 +117,6 @@ scrape_configs: action: keep regex: default;kubernetes;https - - job_name: 'kubernetes-node' scheme: https tls_config: @@ -134,7 +134,7 @@ scrape_configs: - action: labelmap regex: __meta_kubernetes_node_label_(.+) - + {%- if kubernetes_target.get('endpoint', {}).get('enabled') %} - job_name: 'kubernetes-service-endpoints' scheme: https tls_config: @@ -179,8 +179,9 @@ scrape_configs: - source_labels: [__meta_kubernetes_pod_name] action: replace target_label: kubernetes_pod_name + {%- endif %} - + {%- if kubernetes_target.get('pod', {}).get('enabled') %} - job_name: 'kubernetes-pod' scheme: https tls_config: @@ -215,6 +216,7 @@ scrape_configs: - source_labels: [__meta_kubernetes_pod_name] action: replace target_label: kubernetes_pod_name + {%- endif %} {%- endif %} {%- if server.get('target', {}).get('dns', {}).get('enabled', False) %}